Script for calculating password expiry date

Khalnayak
Tera Guru

Hi,

I need to setup password expiry notifications for users whose password are about to expire 10, 7, 4, 3 and 2 days before.

So I have setup the event, and notification, but I need help with the script in the scheduled script execution.

I have a field u_password_last_set which has the date the password was last set.

find_real_file.png

The AD password expires 60 days after it has been set. So I need a script which will work out the date 90 days after and send notifications 10 days before that, or work out date 80 days after and send notification then.

The same will need to be done for 7.4.3 and 2 days before expiry.

Please can someone help with this.

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not use flow designer to send reminder email

refer below links for help

Approval Reminder for Approval Records using flow designer

Approval Reminder Notification for Change records using flow designer

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not use flow designer to send reminder email

refer below links for help

Approval Reminder for Approval Records using flow designer

Approval Reminder Notification for Change records using flow designer

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks @Ankur Bawiskar , I'm trying to look up records where the last password set is is 80 days ago, this flow will  run daily so it needs to be exactly 80 days when the email is sent out.

 

I tried the below but doesnt work. Can you tell me how I can do this please.

 

find_real_file.png

Hi,

You should be using before instead of after

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks @Ankur Bawiskar  but I want to show results for exactly 80 days ago, this shows  everything from 80 days beyond.