December 21, 2011 - Warren Held

Disable Password Expiration for Microsoft Office 365

If your organization uses Office 365 or Hosted Exchange then you are probably aware of the annoying 90-day password expiration policy that Microsoft has in place.  The last I heard the Office 365 team has become so swamped with requests to disable the password expiration that they will not longer do it for you unless you have 500 or more users.  Luckily it is pretty easy to do yourself.  You will need Windows PowerShell. If you are running Windows 7 or Windows Server 2008 then you already have PowerShell. If you are running Windows XP you can get it here, and if you are running Windows Vista you can get it here. Once you have PowerShell installed continue with the steps below.

Step 1:

Download and install Microsoft Online Services Module for Windows PowerShell (links below).

32-bit version
64-bit version

Step 2:

Run Microsoft Online Services Module for Windows PowerShell by going to Start -> All Programs -> Microsoft Online Services -> Microsoft Online Services Module for Windows PowerShell.

Step 3:

To disable password expiration for one user:

[bash]$cred=Get-Credential
Connect-MsolService -credential $cred
Get-MsolUser -UserPrincipalName user@company.com | Set-MsolUser -PasswordNeverExpires $true[/bash]

To disable password expiration for all the enabled users:

[bash]$cred=Get-Credential
Connect-MsolService -credential $cred
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true[/bash]

The $cred=Get-Credential command will ask you for your administrator credentials and then save them to the variable $cred.  The Connect-MsolService connects PowerShell to your Exchange Online service.  The Get-MsolUser command retrieves a mailbox or a list of mailbox’s and the Set-MsolUser -PasswordNeverExpires sets the password never expires property on the account or accounts.

Exchange Online / Office 365 Office 365 /