Account Security Problems

How to Send Email Notifications Before Microsoft 365 Password Expiry

Elise WilliamsElise Williams Nov 3, 2026 869 views

Question details

The user wants to configure the system to send email notifications to users before their account passwords expire, rather than relying on the standard 14-day system prompt.

How to Send Email Notifications Before Microsoft 365 Password Expiry
Product
Microsoft 365
Device & OS
not provided
Scenario
Administrators managing user accounts and password expiration policies for a Microsoft 365 organization.
Observed behavior
Microsoft 365 displays a password-expiry notification 14 days before expiration during sign-in, but fails to send an automated warning by email.
Before you start

Ensure you have global administrator privileges in your Microsoft 365 tenant and a basic understanding of executing PowerShell scripts for administrative tasks.

Solution 1Recommended

Use a Custom PowerShell Script to Automate Expiry Notifications

Since Microsoft 365 lacks a native toggle for password-expiry email alerts, administrators must deploy a PowerShell script to query expiration dates and dispatch customized emails.

Microsoft designed its systems to show expiration prompts directly on the login screen or desktop applications to minimize phishing risks. Consequently, there is no built-in administrative setting to enable email notifications for password expiry.

To achieve this, you must rely on a custom PowerShell script. The script connects to your directory, retrieves user password expiration dates, identifies which users are within the warning window (e.g., 14 days), and sends an automated warning email.

1
Connect to your tenant via PowerShell

Open PowerShell as an administrator and connect to your Microsoft 365 tenant using the Microsoft Graph PowerShell module or the MSOnline module (e.g., Run 'Connect-MgGraph').

2
Query user password expiration dates

Use the appropriate cmdlet (such as 'Get-MgUser') to fetch all active users and retrieve the 'PasswordPolicies' and last password change timestamps to calculate when each password expires.

3
Filter users in the warning window

Add a condition in your script to filter out users whose calculated expiration date falls exactly within your desired threshold, such as 14, 7, or 3 days from the current date.

4
Configure the email notification

Use the 'Send-MailMessage' cmdlet or the Microsoft Graph API to format an automated email. Include clear instructions for the user on how to safely reset their password.

5
Automate the script execution

Set up a recurring task using Windows Task Scheduler on a local server, or use Azure Automation to run the PowerShell script daily.

Use a Custom PowerShell Script to Automate Expiry Notifications
Community Support for Scripts: Writing this script from scratch can be complex. You can find robust, pre-built scripts and get help tailoring them to your tenant's needs in the Microsoft PowerShell Community forums or on GitHub.
Free Microsoft Office alternative

Experience a Free and Lightweight Alternative to Microsoft Office

While managing complex enterprise settings like password expiry notifications in Microsoft 365 can be cumbersome, providing your team with efficient office software doesn't have to be. Consider WPS Office as a free, lightweight, and highly compatible alternative that reduces administrative overhead.

  1. 1. Download WPS Office: Visit the official WPS website to download the free installation package for your operating system.
  2. 2. Install and launch the suite: Run the installer and open WPS Office to access Writer, Spreadsheet, and Presentation tools in one unified interface.
  3. 3. Open existing Office files: Drag and drop your existing .docx, .xlsx, or .pptx files directly into WPS Office to continue your work seamlessly.
Highly compatible with Microsoft Word, Excel, and PowerPoint file formats.No complex cloud tenant management or mandatory password rotation rules required for basic offline use.Lightweight software design that runs smoothly even on older devices.Familiar user interface for seamless employee migration and minimal training.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't Microsoft 365 send password expiry emails by default?

Microsoft designed the system to prompt users during the sign-in process rather than via email. This approach helps protect organizations from phishing attempts, as malicious actors frequently use fake 'password expiration' emails to steal credentials.

Can I use Azure Automation to run the password expiry PowerShell script?

Yes, using Azure Automation Runbooks is a highly recommended method for running these scripts. It eliminates the need to maintain an always-on, on-premises server specifically for Windows Task Scheduler.

Are there third-party tools that can send Microsoft 365 password expiry emails?

Yes, several third-party Active Directory and Microsoft 365 management tools offer built-in, GUI-based password expiration email notifications. This is a great alternative if you prefer not to manage and maintain custom PowerShell scripts.