There’s no direct, native way in AD to trigger a PowerShell script immediately upon user creation without using some form of external monitoring or integration. The most straightforward solution is to incorporate the script call into your user creation process (if not present, you might think about setting it up).
Run Powershellscript immediatly after user creation

Is there a way to start a Powershell script directly after creating an AD user? So that the script is triggered, so to speak, by the “AD user created” action/event. However, I don't mean the event that occurs in the event log. I also don't like the detour using scheduled tasks. I would like to trigger the script directly after creating the user (e.g. to set a few standard AD groups).
Windows for business Windows Client for IT Pros Directory services Active Directory
Windows for business Windows Server User experience PowerShell
2 additional answers
Sort by: Most helpful
-
Rich Matheisen 47,901 Reputation points
2025-02-03T21:02:27.6533333+00:00 3rd-party software. Adaxes (adaxes.com), or ADManager Plus (https://www.manageengine.com). There may be others. Those products expect you to use their software to create the users, though.
Are you using just AD Users and Computers to create those users, or are you using your own script? If it's your script, just incorporate the process into your script. Probably the best way would to be to create a script module and load the module wherever you need it (or let PowerShell auto-load it if it's in one of the module directories).
@Martin Brandl has the right idea.
-
Anonymous
2025-02-05T04:02:44.0966667+00:00 Hi Andy,
You can create a scheduled task triggered by the event 4720.
In the Triggers tab, set the Log to Security, Source to Microsoft Windows security auditing, and Event ID to 4720.
In the Actions tab, you can run the specified PowerShell script.
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.