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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating Managed By Field in AD 1

Status
Not open for further replies.

JazzFan

Technical User
Apr 8, 2003
18
0
0
US
Hello all, how do I reference the Managed By field for computers in Active Directory?. I have tried the following but with no success.

objComputer.Put "managedby", strManagedBy
objComputer.Setinfo

objComputer.Put "name", strManagedBy
objComputer.Setinfo

Thanks in advance for your help.
jazzfan
 
objComputer.Put "managedby", strManagedBy
strManagedBy must contains the DN name.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV, I guess the question should have been:
Is managedby the right name for this field?, or is just name? I have tried both and neither works.
jazzfan
 
The syntax is:
objComputer.Put "managedBy", "DISTINGUISHED NAME VALUE"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks again PHV. Here's how it finally worked.

Set objManager = GetObject("LDAP://CN=" & strManagedBy & ",DomainName")

Set objComputer = GetObject("LDAP://CN=" & strHostName & _
",DomainName")

objComputer.Put "managedby", objManager.Get("distinguishedName")
objComputer.Setinfo

Thanks again and have a star!!
jazzfan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top