0
votes

I know the answer is probably no, however, I figured before I give up I may as well ask. Is it possible to find all objects in OU using distinguishedName, let say I need to find all objects in OU which is called Groups, i try to use something like this, but it dosn't work

(DN=*OU=Groups,OU=Corp-Users,DC=fabrikam,DC=internal)
1

1 Answers

0
votes

Try ldapsearch -s one -h ldaphost -b "OU=Groups,OU=Corp-Users,DC=fabrikam,DC=internal" "objectclass=*" dn to get all nodes of the level OU=Groups,OU=Corp-Users,DC=fabrikam,DC=internal. Replace the -s one with -s sub to get all subentries as well.

What does it do?

It uses OU=Groups,OU=Corp-Users,DC=fabrikam,DC=internal as the search base (-b) and searches just on that level (-s one) or on all sublevels (-s sub) all nodes that have an attribute objectclass set (which should be every node!)

The rest is just syntactical stuff that might be needed like setting the LDAP-Host (-h ldaphost) or just returning the dn (the dn right at the end)

I'm not sure what the command for windows is though.