• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 470
  • Last Modified:

Using LDAPSEARCH to return all Groups and OU's in an Active Directroy 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.

Thanks for any assistance
2 Solutions
Will SzymkowskiSenior Solution ArchitectCommented:
Take a look at this technet under "examples" as it will show you the syntax for All Groups and All OU's.


Hope this helps
Try -

ldapsearch -LLL  -H ldaphost -x  -D 'domain\binddn' -w 'binddnpasswd' -E pr=1000/noprompt -b 'ou=mydomain,dc=namepace,dc=domain,dc=com' '(|(objectClass=organizationalUnit)(objectClass=Group))'

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now