0

I'm writing a permission checking scheme for a website, and want it to integrate with Active Directory. My question is how to check group membership for a specific username and group. I have the linked server, but I don't know how to query AD.

I'm new to Active Directory, so an explanation of the acronyms would be nice.

Thanks in advance!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Joshua M. Moore
  • 381
  • 6
  • 20

1 Answers1

0

This worked:

SELECT * FROM OpenQuery (
ADSI,
'SELECT *
FROM ''LDAP://company.com/DC=company,DC=com''
WHERE objectCategory = ''User''
AND sAMAccountName = ''username''
AND memberOf=''cn=CM_Documents_ALL,OU=Groups - Website,OU=CompanyName,DC=company,DC=com''
')
Joshua M. Moore
  • 381
  • 6
  • 20