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

pulling Organizational unit in Vbscript

Status
Not open for further replies.

scloan

MIS
Feb 17, 1999
9
US
I am trying to pull the OU belonging to individual users within a vbscript. I'm not having any luck. Does anyone know how to pull the OU? Thanks.
 
Here is the most basic way I know of to return the Ldap path of the OU the user is located in. From that point, you can bind to to OU object and extract any additional information you might need.

'>Bind to Active Directory System Info
Set AdsSysteminfo = CreateObject("adsysteminfo")
UserOU = GetObject("LDAP://" & adsSysteminfo.UserName).Parent
msgbox UserOU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top