Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Ad Group user is member of

Author  Topic 

mchohan
Starting Member

39 Posts

Posted - 2010-05-13 : 09:21:18
Hi
I have the below query that gives me the user information. However I can't get the groups the user is a member of. Could you point me in the right direction? Thanks.

SELECT objectGUID,samAccountName, givenName [First Name], sn [Last Name]
FROM OPENQUERY(ADSI,'SELECT objectGUID,samAccountName, givenName, sn, legacyExchangeDN FROM ''LDAP://domain.local'' WHERE objectClass=''Person'' AND objectClass = ''User''') WHERE givenName IS NOT NULL
order by [last name]

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-05-13 : 11:36:50
http://sqlsolace.blogspot.com/2006/06/querying-active-directory-group.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -