Using LDAPSEARCH to return all Groups and OU's in an Active Directory domain [closed]
Asked Answered
L

2

10

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.

Laboy answered 16/9, 2013 at 0:57 Comment(0)
P
16

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

Plimsoll answered 17/9, 2013 at 10:56 Comment(0)
S
0

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))" 
Spier answered 8/3, 2024 at 13:43 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.