Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add values to 2 User Account attributes

Status
Not open for further replies.

sxie

Technical User
Sep 10, 2003
8
US
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
 
Hello sxie,

May be just a typo?
Code:
Set objUser = GetObject("LDAP://[COLOR=red]CN=Xp.Testuser[/color],OU=Users,DC=xxx,DC=com")
regards - tsuji
 
Hello, yes indeed I had a typo. However, after removing the double quotes from the value of CN, I am getting error "A referral was returned by the server". Any idea what that would mean?
 
sxie,

Are you saying you still can get pass the getobject line? "A referral was returned by the server" is very broad. Verify your user's dn.

- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top