Automatic creation of employees using Azure Automation
- Ómar Örn Magnússon
- Apr 17, 2020
- 2 min read
When a customer asked me to automate his onboarding experience from a SharePoint list, I looked at possible solutions and came across this post and thought wow that is brilliant but wanted to create the user in the on-premise Active Directory first and saw it was straightforward with Azure automation in the middle
The idea is that creating new users and computers should be automatic and the workflow starts and ends in one central place, for this demo we decided to user Sharepoint because this client had office 365 which includes Sharepoint. Power Automate comes free to use with other o365 products and has built-in connectors.

The process starts by drawing up the flowchart like this drawing,
here is the Process
Go to portal.azure.com and sett up automation. If you don’t have an Azure subscription, its free to create and includes 200 minutes per month, which is more then enough for this project.

Get the create ad user PowerShell script from the PowerShell gallery

Edit the script, so it reflects on the attributes and OU you want it to create users in

Install the Hybrid worker on the on-premis management server with Active directory PowerShell module installed, script here

Here is the script I used

Create the Sharpoint list, go to list settings, and edit the fields to match the PowerShell script used.

Fire up Power Automate and create a flow from approval template

Add the Azure automation “create ad user” action if the item is approved.

Then when you create a user in the Sharpoint list, approval email will be sent, and if approved, the account gets created in Active Directory as configured by the script.
The next step would be to add more systems to create the users in more places.









Comments