Traditionally, IT may delegate permissions in Active Directory Users and Computers (ADUC) to managers or other users who need to create new accounts. However, with Power Automate for Desktop, IT admins have another tool that may prove helpful in delegating Active Directory tasks, such as creating Active Directory users.
Latest posts by Brandon Lee (see all)

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.

Connecting to Active Directory with Power Automate for Desktop

Connecting to Active Directory with Power Automate for Desktop

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.

Enter connection details to connect to Active Directory

Enter connection details to connect to Active Directory

Next, add the Create user action.

Add the Create user action to the workflow

Add the Create user action to the workflow

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.

Manually creating a user using the Create User workflow

Manually creating a user using the Create User workflow

After clicking Save and running the workflow with just the two steps included, we can successfully add a user to Active Directory.

New user is created in Active Directory

New user is created in 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.
Overview of the import from CSV process

Overview of the import from CSV process

In the Read from CSV file step, point the action to a CSV file.

Read from a CSV file

Read from a CSV file

In the advanced options, flag the First line contains column names option.

First line contains column names

First line contains column names

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.

Retrieve data table column into list

Retrieve data table column into list

Finally, on the Create user task, populate the variables based on the mappings created in the Retrieve data table column into list task.

Creating the user based on CSV values

Creating the user based on CSV values

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.

avataravatar
4 Comments
  1. okolosov (Rank 2) 1 year ago

    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?

  2. Szilveszter Salamon 1 year ago

    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…

  3. Nafees 10 months ago

    Getting the below error when running the Flow:

    “There is no such object on the server. (Exception from HRESULT: 0x80072030)”
    Could you please advise?

  4. Everton 8 months ago

    Hello Brandon.

    Do you know how I can get information from a user logged into Windows using Get User Information?

    Regards,
    Everton

Leave a reply

Your email address will not be published.

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account