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 ...
-
28th August 2009, 12:28 PM #1 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
-
-
IDG Tech News
-
28th August 2009, 01:12 PM #2 
Originally Posted by
maf_001
$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 01:47 PM.
-
SHARE:
Similar Threads
-
By TwyloII in forum How do you do....it?
Replies: 7
Last Post: 16th January 2009, 01:20 PM
-
Replies: 3
Last Post: 9th January 2009, 07:17 PM
-
By Patk100 in forum Windows
Replies: 4
Last Post: 4th April 2008, 05:06 PM
-
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
-
Forum Rules