Python – How to run a python script when a new user is created in Active Directory

active-directoryhookpythonscripting

For some background information: we're a Windows environment using server 2008 with AD for desktop auth. We are an online retail business; our online presence and our intranet are *nix based.

When we have a new user, I want to be able to simply create that user within Active Directory and then have that go off and create matching user accounts in our intranet system.

Is there some Active Directory hooks I can use to run a simple python script when I create a new user?

Best Answer

I don't believe there are any accessible hooks for new user creation in AD. You could do a script to poll for users, keep track of the existing ones, and then provision any new users. I think that's about as good as you're going to get. The other option is to provision your AD users with Python from your intranet side. Creating AD users is fairly easily scriptable. Or like Natxo said, just change your intranet system to authenticate on AD. I'm sure there are a lot of politics so I will assume that is not an option.

Related Topic