How To Set an Office365 Account Password to Never Expire

By default, the passwords for Office365 accounts are set to expire after 90 days. In some situation that may interfere with other applications that sends email with that account. In order to set them to never expire, the PasswordPolicies setting needs to be changed.

You can however turn off password expiration or change the days before expiration in Office365 via powershell commands.

MSOline Module

If you don’t have MSOline module installed, open PowerShell using Run as Administrator and use this to install:

				
					Install-Module MSOnline
				
			

To connect to it, use this cmdlet, entering your administrator username and password when asked.

				
					Connect-MSOLService
				
			

To list all users and see their password expiration setting, use this cmdlet:

				
					Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
				
			

Check Password Settings

To check the PasswordNeverExpires for just one user, use this command, replacing alias with the user’s alias.

				
					Get-MSOLUser -UserPrincipalName alias | Select PasswordNeverExpires
				
			

Set passwords to never expire

Use this command to set all user’s passwords to never expire.

				
					Get-MSOLUser  | Set-MSOLUser –PasswordNeverExpires $true
				
			

To change a single user, use the following command, replacing alias with the user’s alias.

				
					Set-MsolUser -UserPrincipalName alias -PasswordNeverExpires $true
				
			

To change the passwords to expire, run the cmdlet above but use $false instead of $true.

Facebook
Twitter
LinkedIn
Reddit
Email
Print

Leave a Reply

Your email address will not be published.

Leave a Reply

Your email address will not be published.