Create an AD user from a SQL Server trigger Running SQL Server 2008 (10.0.5520) - I have a trigger that is executed when a new record is added to the security table. I would like to extend this trigger, and create an entry in the AD system with a couple of the parameters from the insert.

Question is: can this be accomplished? If so, how?

It looks like a command line tool does exist:

Technet reference

To create a contact named Jeff Hay in a top-level OU named Service Dept in the fabrikam.com domain, at a command prompt, type the following command, and then press ENTER:

dsadd contact "cn=Jeff Hay,ou=service dept,dc=fabrikam,dc=com" 


Can this command line be executed from the trigger?
What @Mike_Fal said. This is a huge gaping security hole. Not only does SQL need xp_cmdshell, but it will need Domain Admin rights. I also agree with the other sentiments around not using a trigger.

You can still tie it in with your existing process and make it database driven with the security table you are using. I'd probably write a separate, asynchronous process to read from the security table and add the AD users that way. This is a great job for PowerShell; connecting multiple systems and technologies.