+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, Powershell modify multi-string values in AD in Coding and Web Development; I am modifying some AD values using powershell, below is part of a standard update for AD, but i am ...
  1. #1
    maf_001's Avatar
    Join Date
    Feb 2008
    Posts
    51
    Thank Post
    2
    Thanked 12 Times in 10 Posts
    Rep Power
    16

    Powershell modify multi-string values in AD

    I am modifying some AD values using powershell, below is part of a standard update for AD, but i am trying to add multiple values for otherIpPhone, can anyone help me with the code that i need to do this?


    $url= "sometexthere"
    $objUser = [ADSI]"LDAP://CN=$cn,OU=$usertype,OU=$fullname,DC=domain,DC=co,D C=uk"
    $objUser.put("otherPager", "$url")
    $objUser.put("otherIpPhone", "$membertype")
    $objUser.setInfo()

    The values are all populated in my full script this is just a cut out,

    The only other way I can think to do this is to pipe the update into admodify command line tool.

    I have a vbs script to do this but i need to do this via powershell if possible,

    Thanks

    Mark

  2. #2


    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,286
    Thank Post
    123
    Thanked 347 Times in 286 Posts
    Blog Entries
    4
    Rep Power
    140
    Quote Originally Posted by maf_001 View Post
    $url= "sometexthere"
    $objUser = [ADSI]"LDAP://CN=$cn,OU=$usertype,OU=$fullname,DC=domain,DC=co,D C=uk"
    $objUser.put("otherPager", "$url")
    $objUser.put("otherIpPhone", "$membertype")
    $objUser.setInfo()
    $arrMemberType = (values you want to use)
    $objUser.PutEx($arrMemberType.Count, "otherIpPhone", $arrMemberType

    Try that one.
    Last edited by jamesb; 28th August 2009 at 02:47 PM.



SHARE:
+ Post New Thread

Similar Threads

  1. Compare Values Above, Equal and Below
    By TwyloII in forum How do you do....it?
    Replies: 7
    Last Post: 16th January 2009, 01:20 PM
  2. Mysql - pre-pend to string
    By danIT in forum Coding
    Replies: 3
    Last Post: 9th January 2009, 07:17 PM
  3. AD Bulk Modify
    By Patk100 in forum Windows
    Replies: 3
    Last Post: 4th April 2008, 06:06 PM
  4. need to extract text from a string in excel
    By projector1 in forum How do you do....it?
    Replies: 7
    Last Post: 14th February 2007, 02:41 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •