I have tried many queries, but this gets me my OU:
(&(objectCategory=organizationalUnit)(Name=MyOU))
(I just get the ou here)
I tried to use (&(objectCategory=organizationalUnit)(objectClass=group)(Name=MyOU))
but failed.
Also, (&(objectCategory=Group)(cn=MyOU,dc=mytop,dc=mysuffix))
and failed.
I am trying to get the groups within the OU. I have searched a lot but cannot come up with it. How do I find the groups within the OU? I have a routine that will print out the groups. I just can't get the query right.
Thank you for any help.
To search for the LDAP configuration, use the “ldapsearch” command and specify “cn=config” as the search base for your LDAP tree. To run this search, you have to use the “-Y” option and specify “EXTERNAL” as the authentication mechanism.
Groups are for granting access to data and organizational units (OUs for short) are for organizing and controling objects (users and computers) via delegation and group policy settings.
cn=MyOU,dc=mytop,dc=mysuffix
does not go in the filter - this is the Base DN of your search.
The filter you need is just (objectClass=group)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With