How to create a automate flow which fetch's the data of users from azure active directory

Copper Contributor

Hi All, 

I am new to Power Automate however, I want to know is there any way to create a automate flow which will fetch the data of "All" users from Azure active directory.

 

Goal: An email should be trigged to a particular team after the termination/offboarding of an employee through power automate.

 

We disable the user's account from AAD by setting 'accountenabled: No' 

 

Please help :) 

1 Reply

Hi @shamuvel,

To create an automated flow that fetches data of all users from Azure Active Directory (AAD) and triggers an email after an employee is terminated or offboarded, you can follow these steps:

  1. Sign in to Power Automate (https://flow.microsoft.com/) using your Office 365 or Microsoft 365 account.

  2. Click on "Create" in the top navigation bar and select "Automated - from blank" to start creating a new flow.

  3. Give your flow a name and select the trigger action. In this case, you can use the "Azure AD - When a user is deleted" trigger. This trigger will fire whenever a user is deleted from Azure Active Directory.

  4. Connect to your Azure AD account by providing the necessary credentials.

  5. Add an action to retrieve the data of all users from Azure AD. Search for and select the "Azure AD - Get user" action. Set the parameters to fetch all users by leaving the User (UPN or Object ID) field empty.

  6. Add another action to send an email notification to the relevant team. Use the "Office 365 Outlook - Send an email" action. Fill in the required details such as the recipient email address, subject, and body of the email. You can also include dynamic content from the previous step to provide user information.

  7. Save the flow and test it by deleting a user from Azure AD. Verify if the flow triggers and sends the email notification.

Make sure you have the necessary permissions to access and manage Azure AD users and send emails.

By following these steps, you can create an automated flow that fetches user data from Azure AD and triggers an email notification when an employee is terminated or offboarded.

Kindest regards