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
 General SQL Server Forums
 New to SQL Server Programming
 Query AD for Group Membership

Author  Topic 

s_anr
Yak Posting Veteran

81 Posts

Posted - 2010-11-24 : 20:03:06
I just want to find out the details or list the emmbers of a Particular Distibutin List by connecting through SQL. I understand tat there is a limitation of 1000 record, but my DL is not that big.

My requirement is not very dynamic : Just list the members of a particular DL

I followed the following but it gives a list of users but not the member of the DL.

Step 1: Create a linked server to your Active Directory 

sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'

Step 2: Create a view in SQL server using OPENQUERY to select from Active Directory

CREATE VIEW dbo.vw_AD_USER_INFO
AS

SELECT * FROM OpenQuery(ADSI, 'SELECT title, displayName, sAMAccountName, givenName, telephoneNumber, facsimileTelephoneNumber, sn FROM ''LDAP://DC=whaever,DC=domain,DC=org'' where objectClass = ''User''')

GO

s_anr
Yak Posting Veteran

81 Posts

Posted - 2010-11-30 : 13:27:44
Can anyone help Please....
Go to Top of Page
   

- Advertisement -