Set Office 365 Passwords to Never Expire

Print Friendly, PDF & Email

In BPOS, users would at least get a warning when they logged in. In Office 365, we’re seeing passwords expire and nobody knows why their Outlook or Lync suddenly stopped working. You can always have someone go to and reset their password – it’s rather simple. But even less of a headache? Make it so that their passwords don’t expire. Follow the step by step below:

Download & install the cmdlet programs (you may
already have these and be using them).

  • Microsoft Online Services Sign-In Assistant (IDCRL7) (32 or
  • Microsoft Online Services Module for Windows PowerShell (32 or 64-bit).

Now launch the Microsoft Online Services Module for Windows PowerShell
from your desktop or start menu and enter each of the following commands one at a time (each bullet
point is one command NOTE that some commands may span more than one line due to web formatting – look for the actual BULLET POINTS to show you the beginning of each new command and copy it entirely).

  • $LiveCred = Get-Credential
  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange
    -ConnectionUri -Credential
    $LiveCred -Authentication Basic -AllowRedirection
      a password).
  • Import-PSSession $Session
  • Connect-MSOLService
  • Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

And now you’re all set! Passwords won’t expire any more and passwords which have expired already will begin working again within minutes.

4 thoughts on “Set Office 365 Passwords to Never Expire

  1. Raj, what is the error?  You may need to right click and run the PowerShell as Administrator. that same forum post I just linked to, Yonis_MSFT also suggests:

    The reason for the error I pasted above was the registry value for the “WebServiceUrl” was pointing to a different URL domain from the domain I was logining in to the UI.
    Try cheking your registry value for key “HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSOnlinePowerShellPath”, “WebServiceUrl”
    The format is like below.

  2. I have discovered a small change to the syntax on the Connect-MSOLService line.

    You can enter:

    Connect-MSOLService -Credential $LiveCred

    and it will keep you from having to enter your credentials again, assuming your entered them correctly the forst time when you set the variable.

This site uses Akismet to reduce spam. Learn how your comment data is processed.