Hi All,
I wanted to write a sql query to return all the users from a specific AD Group specifying the Group Name instead of the CN value in memberof.
I have written the query as shown below. kIndly help me on the same :
SELECT sAMAccountName as Login
FROM OPENQUERY( ADSI,
'SELECT sAMAccountname FROM ''LDAP:// DC=<<MyDomainName>>,DC=com''
WHERE objectCategory=''person'' AND objectClass=''user'' AND memberOf=''CN=<<MyGroupName>>,OU=BI,OU=Administrator Accounts,OU=MIS,OU=Corporate Users,DC=<<MyDomainName>>,DC=com''')
Kindly help me on the same
Thanks
ram