- SCP from remote to local - Wed, May 31 2023
- Understanding Kubernetes Persistent Volumes - Mon, May 29 2023
- Pulseway 9.2: Remote monitoring with workflow automation - Thu, May 18 2023
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.
Thank you for the detailed manual, it will be useful to test in the work. Maybe you know some service where you could distribute the load across multiple admins while remotely connecting to clients?
The problem is, missing the UPN in AD if the user was create, we cant move the object for other OU because DN name missing and cant we add custom attribute exmpl.: department…
Getting the below error when running the Flow:
“There is no such object on the server. (Exception from HRESULT: 0x80072030)”
Could you please advise?
Hello Brandon.
Do you know how I can get information from a user logged into Windows using Get User Information?
Regards,
Everton