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

chumley picture chumley · Sep 16, 2013 · Viewed 13.9k times · Source

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.

Answer

jwilleke picture jwilleke · Sep 17, 2013

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