Import Active Directory users and groups in SQL Server (possibly through C #)

I need to import all ad groups from multiple OUs into a table on SQL Server 2008. After that, I need to import all members of these groups into another table. I can use C # to do the work and transfer data to the SQL server or do it directly on the SQL server.

Suggestions for the best approach to this?

+4
source share
3 answers

Arry

I donโ€™t know for sure, but I found some links that may help you. I think the hottest track is an expression:

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

I found it in LDAP Query for group members on the ColdFusion community site. I am more or less sure that the filter can be easily applied to your request. Sorry, but I canโ€™t verify this because I donโ€™t have AD here.

This may also be a little (but less) interesting:

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

Hope this helps, hooray

Matthias

+3
source

Add the linked server to your SQL Server and query Active Directory for LDAP queries. This is described here quite well:

Create a SQL Server View for Your AD Users, Brendan Tompkins (MVP)

+8
source

Since the OP of this question seemed open to other technologies (3 years ago), I published going through SSIS as an AD query technology for users, writing these users to a table and group searching for these users, SSIS Active Directory data source Even if you are not interested SSIS, an LDAP query for source objects, and C # membership for a group can be convenient for anyone considering this issue.

+1
source

Source: https://habr.com/ru/post/1277731/


All Articles