- Split-brain DNS deployment using Windows Server DNS policy - Wed, Nov 30 2022
- Veeam Backup for Microsoft 365—Why you need to back up your M365 data - Tue, Nov 15 2022
- Cloud-based patch management with Action1 - Tue, Nov 8 2022
Power Automate for Desktop is a free tool from Microsoft that provides workflows to automate repetitive or tedious tasks. The tool provides an intuitive interface, including a workflow designer with drag-and-drop functionality to take advantage of prebuilt actions. In addition, this functionality enables recording user actions called "flows."
If you are using Windows 11, Power Automate for Desktop is built into the operating system.
Automate Active Directory tasks ^
A common use case for managing Active Directory is delegating low-level tasks to non-technical users, such as managers in each department, to create users, add users to groups, unlock accounts, reset passwords, etc. With Power Automate for Desktop, Microsoft has added some built-in workflows for that purpose.
Let's look at the common task of creating new users and see how this can be done using an interactive approach or importing multiple users from a CSV file.
Create AD users with Power Automate for Desktop ^
The first thing you need to do is connect Power Automate for Desktop to Active Directory. Microsoft has included built-in actions to control connectivity to Active Directory. For example, you can search for "connect" and see the Active Directory options listed.
In the Connect to server dialog box, enter your LDAP connection information. Make sure you capitalize the LDAP and don't use "ldap," as it will cause an error.
Next, add the Create user action.
In the Create user dialog box, you can enter the relevant information for creating a new user, including location, first name, last name, username, and password.
After clicking Save and running the workflow with just the two steps included, we can successfully add a user to Active Directory.
Import users from a CSV file ^
Microsoft does not provide examples of working with CSV files to import users into Active Directory. However, this can be accomplished with a few of the built-in actions. Below is an example.
The basics are the same. First, connect to Active Directory. Then, do the following:
- Read the data from the specified CSV file.
- Retrieve data table column into a list—Assigns a variable based on the index position of the CSV file data.
In the Read from CSV file step, point the action to a CSV file.
In the advanced options, flag the First line contains column names option.
On the Retrieve data table column into list step, configure a column name or index to a variable. For the test flow, I created a separate data retrieval process for each column of the CSV.
Finally, on the Create user task, populate the variables based on the mappings created in the Retrieve data table column into list task.
For iterating through a list of users in the CSV file, you can place the steps in a For loop, which will process the whole CSV file and create multiple users.
IT admins can create the workflows in Power Automate for Desktop and provide the flows to delegated users. Executing the flows requires no technical knowledge of creating users in Active Directory. The required fields can be prepopulated, either from a CSV or saved in workflows.
Thoughts and impressions ^
Power Automate for Desktop is a great tool that provides many automation capabilities for organizations looking to empower users with automated tasks.
Subscribe to 4sysops newsletter!
The Active Directory capabilities now built into Power Automate for Desktop enable IT admins to create workflows and tasks, so that users can carry out low-level account creation and other tasks. As demonstrated, using only a few automation flow tasks, users can easily be created in Active Directory by either manually filling in the form or using a CSV file.