Set Azure AD password expiry with PowerShell

Set Azure AD password expiry with PowerShell

Q. How can I set the Azure AD password expiry policy for a domain?

A. The MS Online PowerShell module can be used to modify the password policy for an Azure AD domain. There are two parameters:

  • Validity Period - Number of days the password is valid for
  • Notification Days - Number of days before expiry users start being notified

This can be configured as follows:

Set-MsolPasswordPolicy -DomainName -ValidityPeriod 1000 -NotificationDays 30

The policy can be viewed with:

Get-MsolPasswordPolicy -DomainName| fl


Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.