1. Create a recurring timer:
2. For testing, you can use search terms from a Search for Users (V2) which will allow you enter names of test users. *obviously test thoroughly before releasing to prod.
3. Using a loop, iterate through each of the values you got from the Search for Users (V2) {Note: Once you are done testing, change the checkbox to Is Search Term Required: No}. Each returned value is the full schema data for a user including name, ID, phone number, country etc. Select only User Id
4. Log into Azure and create a new App Registration, with a suitable name. Select the prefered account type when you are creating the app registration. Accounts in this organizational directory only is usually preferred.
5. Once created, go to API Permissions on the left, add/confirm you have:
User.Read
User.Read.All
If you are missing permissions, click Add a Permission > Microsoft Graph > Application Permission > search for User.Read and click Add Permission. Also do this for User.Read.All. Once complete, click Grant admin consent for <domain name>, you will need administrative permissions for this.
6. Go back to your Flow and use the HTTP Get action to call the Microsoft Graph API. The summary of details is below:
Method: GET
URI: https://graph.microsoft.com/beta/users/UserPrincipalName?$select=lastPasswordChangeDateTime
Authentication: OAUTH
Authority: https://login.microsoft.com
Tenant: Enter tenant ID from Azure AD Portal.
Audience: https://graph.microsoft.com
Client ID: Get this value from the App Registration > Overview section in the Azure Portal
Secret: Go to the App Registration > Certificates and Secrets > + New Client Secret > give it a name and expiration date > copy the value. The value will be unreadable when you leave the page. If you lose it, just re-create it and delete the old.
7. Create a Compose action and use the following as an input body('GetLastPasswordChange')?['lastPasswordChangeDateTime']}
You will notice the GetLastPasswordChange is the name of the HTTP GET. The lastPasswordChangeDateTime is the name of the schema attribute from the user.
8. Use a second Compose action and enter the following expression
9. Depending on your password policy, create a condition for the amount of days needed. You could make this more sophisticated with integration to AAD Groups. If you use Fine Grained Password Policies (FGPP), you could also use on-prem AAD Connect synced groups so users in different groups get different notifications.
10. If Teams notifications are also needed, this is a simple integration.
Hope this helps some people!
Solved! Go to Solution.
Hi @monro ,
Thanks for sharing, your sharing is awesome!!!
Please mark this thread as resolved, this will allow more people to see this thread, which will help more people.
Best Regards
Cheng Feng
Hi @monro ,
Thanks for sharing, your sharing is awesome!!!
Please mark this thread as resolved, this will allow more people to see this thread, which will help more people.
Best Regards
Cheng Feng
Replying to myself
If you have hundreds of users and you need to release to UAT users first, step 2 is not correct and you will need to use an array, which realistically means building a separate flow.
Steps below should be enough to figure out a UAT flow. Format for the Initialize Array is below (no comma on final array line):
[
"UPN 1",
"UPN 2",
"UPN 3"
]