chumley
chumley

Reputation: 173

Using LDAPSEARCH to return all Groups and OU's in an Active Directory domain

What would the correct syntax be, using ldapsearch, to return all Groups\OU's and their nested Groups\OU's in an AD domain? I am trying to query a Windows AD DC from a Linux Box and need to have this result returned to the Linux machine.

Upvotes: 10

Views: 26384

Answers (2)

Felipe Volpato
Felipe Volpato

Reputation: 401

For a full ldapsearch example:

ldapsearch -x -LLL -H ldap://<host IP or NAME> -D <admin dn> -b <base dn> -s sub -w <admin dn pass> "(|(objectClass=organizationalUnit)(objectClass=Group))" 

Upvotes: 0

jwilleke
jwilleke

Reputation: 11026

All groups in the DOMAIN would be:

(objectClass=group)

All groups and OUs would be:

(|(objectClass=organizationalUnit)(objectClass=Group))

Not sure what Groups\OU's implies.

-jim

Upvotes: 16

Related Questions