In Office 365, PowerShell enables many options to manage your users, their mailboxes and domain settings. One of those options is to set a password for an account to never expire. This does not restrict a user from changing their own password, but simply removes the policy that forces a user to change their password. Here’s some examples of PowerShell commands used to manage passwords:
Set a password to never expire:
Set-MsolUser -UserPrincipalName -PasswordNeverExpires $true
If you want to see if a password is set to never expire then run this:
Get-MSOLUser -UserPrincipalName | Select PasswordNeverExpires
Another option is to set all users passwords to never expire, to accomplish this run the following:
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
This is how to manually configure the password for an account and force them to change it at next log on:
Set-MsolUserPassword -userPrincipalName -NewPassword ‘password’ -ForceChangePassword $true
These are a sampling of the commands, to see more type ‘Get-Help Set-MsolUserPassword’ in PowerShell or get-help before any other command to see what’s available.