Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am a .NET developer working on a project I inherited. I need to execute a small program when AD replicates to keep our DB with user information up to date.

Is there a way when AD replicates to include the program as part of a trigger or script?

share|improve this question
1  
Do you really need to trigger based on a replication event? It sure seems you need to know more then just when a replication has happened, don't you also want to know what has changed? –  Zoredache Apr 30 '12 at 21:26
    
See this. Perhaps you will find something useful here. technet.microsoft.com/en-us/library/cc772726(WS.10).aspx –  Zoredache Apr 30 '12 at 21:30

1 Answer 1

Active Directory replicates periodically on its own. You can check event logs periodically for that event ID and know within a minute or two.

With that said, AD is already a "DB with user information." You'd be much better-served by populating your user database directly from AD, or bypassing it altogether.

share|improve this answer
    
Agree that you should just populate your user DB with data from Active Directory. There are multiple ways of querying Active Directory and/or exporting the data from it. You can use PowerShell, VBScript, CSVDE (CSV Directory Export) or numerous other command line tools, or even a connection from SQL Server. –  SturdyErde May 1 '12 at 12:47
    
Yes, I already have the program written to query and extract the information from AD. I just need to have that program run when the replication takes place. Is there a way of triggering a program to run when AD replicates ? –  Alex Smith May 1 '12 at 13:25
    
To my knowledge, you can't "trigger" per se, but you can certainly check logs every n minutes (where n > 1), look for the specific event ID, and fire off the script if there's a new entry with the required event ID. –  Joel E Salas May 1 '12 at 16:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.