LDAP search filter to check if user is member of a group
The member attribute (or memberOf) is a multi-valued DN list. Fortunately, in LDAP the = operator automatically does a “contains” instead of “equals” when dealing with multi-values. So to check if an object is member of a certain group no matter if he/she is member of lots of groups, you can use:
(memberOf=cn=Group1,OU=Groups,DC=tools4ever,DC=local)
If the above LDAP search filter returns any row, the result is TRUE, otherwise FALSE.