Disable Password Expiration Policy in Office365

Chaning the password regularly is a good thing to do. However, this can be quite messy at times, especially when you have a number of devices that depend on this password. It is often easier to set a long and complex password, and to set it once. In this case, you may wish to disable the password expiration policy which is set by default to 90 days.

To do this, you will need the Microsoft Online Services Module for Windows PowerShell. There is a 32bit and 64bit version. You can download them here – http://onlinehelp.microsoft.com/en-us/office365-enterprises/hh124998.aspx#BKMK_install

Once it has been installed, run the PS Command Shell and type the following commands (copy and paste).

  1. PS> $cred = get-credential
  2. Type in the Office365 Admin user. This is usually in the form of admin@[companyname].onmicrosoft.com
  3. PS> Connect-MsolService –Credential $cred
  4. PS> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic -AllowRedirection
  5. PS> Import-PSSession $Session
  6. PS> $users = Get-MsolUser
  7. PS> foreach ($user in $users) { Set-MsolUser –UserPrincipalName $user.UserPrincipalName –PasswordNeverExpires $true }

That’s it. This will disable the password expiration policy for all users for this organisation.

To check this, type PS> get-msoluser | select displayname, passwordexpirationdate


One thought on “Disable Password Expiration Policy in Office365”

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve the Equation to continue * Time limit is exhausted. Please reload CAPTCHA.