Question

I need to import all ad groups in a few OUs into a table in SQL Server 2008. Once I have those I need to import all the members of those groups to a different table. I can use c# to do the work and pass the data to SQL server or do it directly in SQL server.

Suggestions on the best way to approach this?

Was it helpful?

Solution

Arry,

I don't know exactly, but found some links that may help you. I think the hottest track is this expression:

"(&(objectCategory=Person)(memberOf=DN=GroupName, OU=Org, DC=domain,
DC=com))"

I found it in LDAP Query for group members on a ColdFusion community's site. I'm more or less sure the filter can easily be applied to your query. I'm sorry, but I cannot test it, because I have no AD around here.

This one could also be a bit (but less) interesting:

http://forge.novell.com/pipermail/cldap-dev/2004-April/000042.html

Hope this helps, cheers,

Matthias

OTHER TIPS

Add a Linked Server to your SQL Server and query the Active Directory via LDAP queries. This here described this quite well:

Create a SQL Server View of your AD Users, Brendan Tompkins (MVP)

As the OP of this question seemed open to other technologies (3 years ago), I posted a walk through that uses SSIS as the technology for querying AD for users, writing those users to a table and doing group lookups on those users. Active Directory SSIS Data Source Even if you aren't interested in SSIS, the LDAP query for source objects and the C# for group membership might be handy for anyone reviewing this question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top