The default Expiration of user passwords is set to 90 days, here are commands to configure passwords to never expire for Office 365
Open Office 365 Powershell Module as an administrator
To connect run:
(Enter administrator credentials)
Set password never expire for one user
Set-MsolUser -UserPrincipalName email@example.com -PasswordNeverExpires $true
Set password never expire for all user
Get-MSOLUser | set-msoluser -PasswordNeverExpires $true
Check what users have the password never expire
Get-MSOLUser | select user*, password*
Alternatively, to see all users and their "Password never expires setting", you can run the following PowerShell command:
Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
To check if one user has enabled, run the command below:
Get-MSOLUser -UserPrincipalName firstname.lastname@example.org | select user*, password*
Note This procedure does not apply to users who are enabled for single sign-on (SSO). This is because passwords for SSO-enabled users are managed in the on-premises environment. If you try to perform this procedure for an SSO-enabled user, you receive output that resembles the following in Windows PowerShell:
Note Only passwords for user accounts that are not synchronized through directory synchronization can be configured to never expire.
Was this helpful?
Need a hand or want to share your expertise?
Register for CrowdSupport and get involved