By default, Office 365 users password are expired after 730 days. However, you can change the settings from Security & privacy tab in admin center.

This article is written to help you set Office 365 users password to never expire with the help of PowerShell.


Download and install the following PowerShell modules on your machine.

a.    Microsoft Online Service Sign-in Assistant for IT Professionals RTW

b.    Windows Azure Active Directory Module for Windows PowerShell (64-bit version)


1. Open PowerShell with elevated privileges and execute the following command to connect to office 365 subscription.


When you are prompted, provide a global administrator account username and password.

2. When you are successfully connected, issue the following command to set all users password expiration policy to never expire.

Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

3. To verify, issue the following command on PowerShell.

Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

Office 365 Passwords and PowerShell