Technical Reference: How to set Office 365 passwords to never expire

Windows 8 needs a newer version of the sign-on assistant.


1.       Install Microsoft Online Services Sign-In Assistant for IT Professionals BETA

(reboot required)

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

3.       Paste these commands into the PowerShell window:

Import-Module msonline
$cred = Get-Credential
Connect-MsolService -cred $cred
Get-Command –Module msonline

(You will get a pop-up to supply Office 365 user credentials with Admin rights for the account)

4.       Run this command to set all users to not have passwords expire:

Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true


That’s it!


To check All users current settings:

Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

To check a specific user setting:

Get-MSOLUser -UserPrincipalName <Microsoft Online Services ID> | Select PasswordNeverExpires

Example: Get-MSOLUser -UserPrincipalName | Select PasswordNeverExpires


Reference Pages:


Viewed: 13540 as of 09/26/2017

<< Back to Articles