Jun 28 2023 01:29 AM
Jun 28 2023 01:29 AM
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 :)
Jun 28 2023 06:18 AM
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:
Sign in to Power Automate (https://flow.microsoft.com/) using your Office 365 or Microsoft 365 account.
Click on "Create" in the top navigation bar and select "Automated - from blank" to start creating a new flow.
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.
Connect to your Azure AD account by providing the necessary credentials.
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.
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.
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.