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!

Working with LDAP - General query structure

Status
Not open for further replies.

Staticfactory

IS-IT--Management
Mar 1, 2005
79
CA
I posted this question in the LDAP area, but I figured I would drop it here in case it's a simple question for you vbscript vetrans...

I'm just getting my feet wet with VBscript in an attempt to turn tedious/repetitive jobs into scripts. We're about to do some security restructuring in Active Directory and have about 150 different user groups that I would like to generate member reports for. I've been looking at some primers for the coding methods for this, but I'm still hung up on the whole CN/OU/DC structuring of the LDAP string. Of course, I'm not overly thorough in the idea of AD yet either, so please bear with me.

I was hoping someone could clear this up for me using the following example.

Domain is ad.mydomain.net

Under the domain, in the AD console I have NTAM - Toronto - MyCompany - Groups/Users/Computers.

Now, I'm trying to query the groups for it's members but am not sure how to structure the CN/OU/DC elements of the LDAP string to get at them.

I hope this makes a shred of sense!
 
That's a neat little utility, but all I really want to know is the following:

The Example:

ad.MyDomain.net
- NTAM
-- Toronto
--- MyCompany
---- Groups

DC=ad, DC=MyDomain, DC=net, OU=NTAM, OU=Toronto, OU=MyCompany, CN=Groups

Is this correct?
 
Sorry, forgot to add this to the end of the last post...

If I was correct, would this then be the syntax for the LDAP query?

"LDAP://cn=Groups,ou=MyCompany,ou=Toronto,ou=NTAM,dc=ad,dc=MyDomain,dc=net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top