Disable Office 365 Password Expiration

Office 365


By default, the password for a new account in Office 365 will expire every 90 days.  Some companies find this to be an inconvenience.  You can change the Office 365 password expiration length (or disable it altogether.)

There are two methods to change your password duration – through PowerShell or through the Office 365 Admin Center (the web console.) PowerShell give you slightly more granular control – you can remove the password expiration date for individual accounts rather than removing it for everyone.


The first step is to open PowerShell and connect to Office 365 by using the method described in our earlier post.

Let’s take a look at the current password expiration settings by using this command:


There will be two fields:
NotificationDays – the number of days before password expiration that the user will be notified to change their password
ValidityPeriod – the number of days a password is valid before it’s required to be changed

Now let’s find out which accounts are set to never expire:

Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

The output will be a list of all the users along with either “True” or “False” for the PasswordNeverExpires field. When a new user is created, the account defaults to False which means the password will expire after the default duration.

Set the password duration for all accounts

You can globally set the password expiration duration for all accounts with this command.

The syntax:

Set-MsolPasswordPolicy -DomainName <Domain Name> -ValidityPeriod <Number of Days>

And an example:

Set-MsolPasswordPolicy -DomainName symmetrixtech.com -ValidityPeriod 365


Set the notification period for all accounts

This command will set the number of days before your users are notified about an impending required password change.

The syntax:

Set-MsolPasswordPolicy -DomainName <Domain Name> -NotificationDays <Number of Days>

And an example:

Set-MsolPasswordPolicy -DomainName symmetrixtech.com -NotificationDays 14


Remove the password expiration date for an individual account

This command will remove the password expiration for one account in your 365 deployment.

The syntax:

Set-MsolUserUserPrincipalName <UserPrincipalName> -PasswordNeverExpires $True

And an example:

Set-MsolUserUserPrincipalName testuser@5pd.f6b.mwp.accessdomain.com -PasswordNeverExpires $True


Remove the password expiration date for all accounts

The following command will pull the entire user list and dump it into the command to remove the password expiration for all of them:

Get-MsolUser | Set-MsolUser -PasswordNeverExpires $True


Web Administration Console

Log in to your console with an administrative account at http://www.office365.com.  Go to the admin section, then select Service Settings/Passwords:

Password Expiration Menu



Here you can change the password policies, including the duration of the passwords and the user notification period.  You can also just turn them off.  Remember that the ‘never expire’ setting is a global setting in the admin console while in PowerShell you can do it on a per-user basis.

Password Expiration Settings


By |2015-05-11|Office 365|