Hello,
Thanks for posting your question in the Microsoft Q&A forum.
First you should query to check Password Expiry, then set an email to notify the user.
You can do this by running PowerShell script.
Here is a simple script that you can modify as your configuration.
Connect to Azure AD
Connect-AzureAD
Define expiry threshold
$threshold = (Get-Date).AddDays( your password threshold days number)
query for users with expiring passwords by using "PasswordPolicies" and "PasswordExpires"
$expiringUsers = Get-AzureADUser -All $true | Where-Object {($.PasswordPolicies -contains "DisablePasswordExpiration") -and ($.PasswordExpires -le $threshold)}
Script to send email to Users
$sender = "******@you.com"
$subject = "Password will expire soon"
$body = "Your password is expiring soon. Please change it as soon as possible."
foreach ($user in $expiringUsers) {
$recipient = $user.UserPrincipalName
Send-MailMessage -From $sender -To $recipient -Subject $subject -Body $body -SmtpServer "smtp.you.com"
}
Best,
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **