web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Email password expirat...
Power Automate
Answered

Email password expiration notification using Power Automate

(2) ShareShare
ReportReport
Posted on by 164

I have the flow below which fetches the lastPasswordChangeDateTime from Microsoft Graph and filters an array of users by their UPN and lastPasswordChangeDateTime. The current flow sends out a password expiration notification to end users one day before their password expires which works. I wanted to expand this; however, to find users with passwords about to expire between a specific start and end date and then send daily emails until the password expires. for example, 7 days before the password expires I want to start sending a password expiration email daily with the days counted down in each consecutive email with the last email stating their password has expired.

Email 1: your password expires in 7 days
Email 2: your password expires in 6 days...

...

Email 7: Your password has expired.

 

RADical_0-1659912745772.png

 

Any help with this would be much appreciated. Thank you!

Categories:
I have the same question (2)
  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @RADical ,

    you can follow these steps:

    1. Filter the array based on these condition:

    expiring date less or equal than:

    formatDateTime(addDays(utcNow(),7),'yyyy-MM-dd')

    expiring date greater than or equal to:

    formatDateTime(utcNow(),'yyyy-MM-dd')

    all the dates must have the same ISO 8601 format;

     

    2. Add a Compose action in which put the following expression (instead of my sample data, put yours):

    div(sub(ticks(formatDateTime(items('Apply_to_each')?['DueDate'], 'yyyy-MM-dd')),ticks(outputs('Compose-Today'))),864000000000)

    The expression is useful to count the days between two dates (the expiring date and the current date).

    MarconettiMarco_1-1659947488383.png

     

    3. Add a Condition control: if the previous Compose action is not equal to 0, send an email telling that "your password expires in X days" (instead of "X", put the Compose outputs), otherwise send an email telling that "Your password has expired.".

    MarconettiMarco_3-1659947571245.png

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    BR,

    Marco

  • RADical Profile Picture
    164 on at

    Hello @MarconettiMarco 

     

    Thank you for your reply!

     

    I'm still a little new to Power Automate and the concept of using tick is new to me, so please forgive my ignorance. I wanted to clarify a few things.

    1) Currently, I can only extract the last time the user changed their password and not when the actual password expires (90 days from when their PW is first changed). So I'm using the below action to filter output of all users who last changed their password 83 days ago. This would give me all users who will need to change their password which will expire in 7 days.

    RADical_1-1659990510570.png

    2) I need to send an email to the users outputted in the action above on the 83rd day (7 days prior to their PW expires) letting them know their password will expire in 7 days. This will run daily to find all users who fall within the 7 day PW notification period.

    3) I want to generate daily reminders to everyone who fall within that notification period and count down the days until the password expires in the email.

  • Community Power Platform Member Profile Picture
    on at

    @RADical Were you able to set it up? It will be of great help if you can share the complete flow details for reference. We have similar requirement and this seems to be the best option.

  • RADical Profile Picture
    164 on at

    @Anonymous I ended up going a different route by using a branched action approach. It's not ideal if you're doing more than a handful of reminder days, but it satisfied my requirements.

  • GSTew0828 Profile Picture
    5 on at

    @RADical 

    trying to set this up as well and currently banging my head against the wall. 
    would you be able to share your flow details so I can see where I'm going wrong?

  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @GSTew0828,

     

    please show your flow. 

  • RADical Profile Picture
    164 on at

    @GSTew0828 

     

    See below:

     

    High level:

    RADical_1-1666441825200.png

     

    Expanded:

    RADical_2-1666441995875.png

     

    Branches:

    RADical_3-1666442362062.png

     

    I hope this helps. Private message me if you have questions.

     

  • surya3727 Profile Picture
    2 on at

    Send me full work flow..

  • GSTew0828 Profile Picture
    5 on at

    just looking through yours, I wasn't reformatting the last change date so it still had the time assigned, which when I'm trying to match  just the date wouldn't produce an output. 
    That's what I get for doings late at night.

    appreciate the help, can finally move on to the next stage.

     

  • ITSYS Profile Picture
    28 on at

    HI RADical,

    Thank for your share. Please let me know action ' Get GrapAPI' is free or must have purchase for it ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard