maf_001 Posted August 28, 2009 Posted August 28, 2009 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,DC=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
jamesb Posted August 28, 2009 Posted August 28, 2009 (edited) $url= "sometexthere" $objUser = [ADSI]"LDAP://CN=$cn,OU=$usertype,OU=$fullname,DC=domain,DC=co,DC=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. Edited August 28, 2009 by jamesb
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now