Sql – Synchronize SQL with information from Active Directory

active-directorysql

I would like to pass information from Active Directory to a Microsoft SQL Server database any time a change is made in Active Directory. In this way the SQL will always have a reliable copy of the AD.
Well, i have been reading some post that deal with similar questions, but I can't find the solution.

In this post, for example: https://stackoverflow.com/questions/4782292/synchronization-between-c-app-and-active-directory
, a user said:

'…Then let AD synchronize with SQL.'

That sounds good for me, but how can I do that?

@Pablo: So we have an existing c# application that manages users and groups in SQL. We would like this app to manage also the Active Directory. The idea is to query Active Directory (AD) directly with the application but also continue saving the information in the SQL as it does now. But I see a problem: when changes are made only in the Active Directory => SQL will not have an updated information, because we will have different data between AD and SQL.

I see you propose to query AD for changes and it can be done per access or using polling on a scheduled interval. I'm not familiar with it, could you explain me how to do that?

Best Answer

Your best bet here is to have your application query AD for changes. You could do this per access or using polling on a scheduled interval. This can be done a number of ways and if you can provide more information on exactly what you want to accomplish I can provide you with some methods for this.

If all you want to do is update AD just use c# functions to update AD directly, dont even sync it. Googling gave me a few examples: http://social.msdn.microsoft.com/forums/en/netfxbcl/thread/729d1214-37f5-4330-9208-bc4d9d695ad0/

If you truly want to synchronize a system at the enterprise level consider Forefront Identity Manager. This can be used to synchronize different systems.

http://www.microsoft.com/forefront/identitymanager/en/us/default.aspx