How to Set Office 365 Users Password Expiration Policy to Never Expire with PowerShell
October 12, 2017
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.
Prerequisites
Download and install the following PowerShell modules on your machine.
Step-By-Step
1. Open PowerShell with elevated privileges and execute the following command to connect to office 365 subscription.
Connect-MsolService
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
About the Author
You May Also Like