Jump to content

Recommended Posts

Posted

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

Posted (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 by jamesb

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...