Create Users in Entra ID and Assign Licenses | Power Automate

 


Introduction

Our objective is to create a seamless process where new employees added to our organization's system trigger the automatic creation of user accounts in Entra ID. Additionally, we'll ensure that the new users are assigned to the appropriate manager and are granted necessary licenses by adding them to a security group.


Prerequisites

Before we begin, ensure you have the following:


  • Access to Microsoft Power Automate.
  • Permissions to create and manage flows.
  • Credentials for Entra ID and necessary APIs.
  • Security Group


Step-by-Step Guide


1. Sign in to Power Automate

Navigate to the Power Automate portal and sign in with your Microsoft credentials.



2. Create a New Flow

Click on the "Create" button and select "Automated cloud flow" to create a new flow from scratch.



3. Define the Trigger

Choose the appropriate trigger for your scenario. In this case, we'll use "When a row is added, modified, or deleted" trigger, which listens for changes in our employee table.



4. Retrieve Employee Information

Use the desired action to fetch details of the new employee from your data source.



6. Generate Password

Create a random password for the new user using the "Compose" action.



7. Create User in Entra ID

Use the "Create User" action to create a new user in Entra ID. Provide necessary details such as username, password, manager, etc.



8. Add User to License Group

Add the newly created user to the security group containing necessary licenses using the "Add User to Group" action.



5. Retrieve & Assign Manager 

Fetch the manager's details using the "Get Manager Profile" action based on the information obtained from the employee record.



9. Send Confirmation Email

Compose and send a confirmation email to the new user containing login credentials and other relevant information.


6. Test and Save the Flow

Once you've configured all the actions, it's essential to test the flow thoroughly to ensure it works as expected. Once satisfied, save the flow.


Conclusion

In this blog post, we've demonstrated how to create a Power Automate flow to automate the process of creating users in Entra ID when new records are added to an employee table. By leveraging Power Automate's capabilities, organizations can streamline their user management processes, improve efficiency, and ensure consistency across their systems.

Comments