Disable Office 365 Password Expiration

Office 365 has a password policy, which is by default set to expire on a regular basis (90 days). There are some guidelines which help to make sure that the password is secure:

  • Use 8 to 16 characters
  • combination of upper- and lowercase letters
  • at leat one numer or one symbol (be aware that the symbol is available in every language on every keyboard)
  • Do not use spaces, tabs, line breaks, your user name

Each user is able to change his password at any time. If a user forgets his password it can be reset by an Office 365 administrator.

In some cases – for example for service accounts – it is useful to change the password expiration policy to never expire.

In this post I will show you how you can disable the password expiration.

In office 365 you need only two lines to disable the password policy. First open the Microsoft Online Services Module for Windows Powershell. (Download: 32bit or 64bit).

Connect to Office 365


In the dialog enter the credentials of an administrator:


To change a single user:

Set-MsolUser -UserPrincipalName <username> -PasswordNeverExpires $True

To change all users at once:

Get-MsolUser | Set-MsolUser -PasswordNeverExpires $True


That’s it. You can control the result with the following command:

Get-MsolUser | fl

Setting Up Multi-Factor Authentication in Office 365

Office 365 now supports multi-factor authentication “out of the box”.  You can enable users to require additional authentication mechanisms, including a phone call, a text message and an option to support a mobile app. The mobile app is available for Windows, iOS and Android devices, and works similarly to an RSA token in that a 6-digit number is generated every 10-15 seconds.

Once enabled, you can either input additional security information as an administrator or have the user set up their own contact methods.  If this is not done by the administrator, the user will be required to do upon their next login.  Multiple authentication mechanisms are required, in the event that the primary choice is inaccessible/lost.

A couple of additional items to note: