If your company is anything larger than tiny and you are using Microsoft Office 365 or Azure, you will almost certainly run into a situation in which you want to a few user account set to not expire. Perhaps they are service accounts, or they are accounts that contractors rarely use.

Why Microsoft Says User Passwords Should NOT Expire

You might be surprised to find that Microsoft’s official position is that you should not have your Microsoft 365 or azure accounts expire:

Password expiration requirements do more harm than good, because these requirements make users select predictable passwords, composed of sequential words and numbers that are closely related to each other. In these cases, the next password can be predicted based on the previous password. Password expiration requirements offer no containment benefits because cybercriminals almost always use credentials as soon as they compromise them.


How to Set ALL Microsoft Office User Account Passwords To Expire or Not

microsoft office 365 password expiration policy

  1. Sign into https://portal.office.com
  2. Click the ADMIN link (bottom of the left rail)
  3. Click SHOW ALL (on the left menu)
  4. Expand SETTINGS
  6. Click SECURITY & PRIVACY tab along the top
  8. Click the SET PASSWORDS TO NEVER EXPIRE checkbox
  9. Set the number of days between password resets

How To Set a Specific Microsoft User Account to Not Expire

how to set azure microsoft 365 user accounts not to expire

  1. Open a PowerShell (or Windows Terminal) as an Administrator
  2. Enter
    Install-Module MSOnline
  3. Enter
  4. Sign in to the Microsoft Office 365 / Azure account
  5. OPTIONAL: Enter
    Get-MsolUser -UserPrincipalName User@EmailAddress.com
    • This will display some user account information
  6. Enter
    Set-MsolUser -UserPrincipalName User@EmailAddress.com -PasswordNeverExpires $true
  7. Enter
    $user = Get-MsolUser -UserPrincipalName "user@domain.com" | Select-Object UserPrincipalName, PasswordNeverExpires, WhenCreated, LastPasswordChangeTimestamp
    • This will display when the account was created, when the password was last changed, and if it is set to not expire


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *