How to write LDAP query to test if user is member of a group?

You should be able to create a query with this filter here: (&(objectClass=user)(sAMAccountName=yourUserName) (memberof=CN=YourGroup,OU=Users,DC=YourDomain,DC=com)) and when you run that against your LDAP server, if you get a result, your user “yourUserName” is indeed a member of the group “CN=YourGroup,OU=Users,DC=YourDomain,DC=com Try and see if this works! If you use C# / VB.Net and System.DirectoryServices, this snippet … Read more