How do I list the LDAP groups that a user belongs to?

In your search filter, specify the member name and the group objectClasses. For example: ldap.Search("(&(|(uniqueMember=CN=My Name,CN=Users,DC=DOMAIN) (member=CN=My Name,CN=Users,DC=JUNGLE))(|(|(| (objectClass=posixGroup)(objectClass=groupOfUniqueNames)) (objectClass=groupOfNames))(objectClass=group)))");

We appreciate your feedback.  If you have any questions, comments, or suggestions about this article please contact our support team at