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:
- 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
- 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 Get-MsolUser | Format-Table UserPrincipalName,DisplayName,PasswordNeverExpires