expiration

Remove Password Expiration

Many customers ask me the question how they can remove password expiration on their Office 365 environment. With the PowerShell command below this can be achieved:

  1. First make sure you have the remote signed execution policy set to true. You can do this by running PowerShell in admin mode and running: Set-ExecutionPolicy RemoteSigned
  2. Next, run the following to authenticate your self and import PowerShell commands to your local session:
    $LiveCred = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
    Import-PSSession $Session
  3. Get-MsolUser | Format-Table UserPrincipalName,DisplayName,PasswordNeverExpires