I have borrowed a few lines from MS script center to modify certain values on a user account. What I would like to do is to a phone number, then add a value in the "assistant" field. This field is defined in the AD schema but it is not displayed in the AD Users and Computers user account properties. I get error indicating the line 2 "there is no such object on the server". Any help is appreciated!
Const ADS_PROPERTY_UPDATE = 2
Set objUser = GetObject("LDAP://CN="Xp.Testuser",OU=Users,DC=xxx,DC=com")
objUser.Put "telephoneNumber", "(425) 555-1211"
objUser.PutEx ADS_PROPERTY_UPDATE, "assistant", Array("testfield")
objUser.SetInfo
Const ADS_PROPERTY_UPDATE = 2
Set objUser = GetObject("LDAP://CN="Xp.Testuser",OU=Users,DC=xxx,DC=com")
objUser.Put "telephoneNumber", "(425) 555-1211"
objUser.PutEx ADS_PROPERTY_UPDATE, "assistant", Array("testfield")
objUser.SetInfo