Run the following command:
Connect-MsolService
In the Sign in to your account page that opens, sign in with your Office 365 admin account, and click Sign in.Run the following command to set the password of one user to never expire:
Set-MsolUser -UserPrincipalName <name of the account> -PasswordNeverExpires $true
For example, if the name of the account is Ina@contoso.com, you'd type the command like this: Set-MsolUser -UserPrincipalName Ina@contoso.com -PasswordNeverExpires $true
If you get a red error message, there's probably a typo or an extra space. Try again! Or, copy and paste the above to the PowerShell prompt, and use the arrow key to erase <name of the account> and enter the real name of the account.Run the following command:
Connect-MsolService
In the Sign in to your account page that opens, enter your admin credentials to connect to the service, and click Sign in. Run the following command
Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires
Get-MSOLUser -UserPrincipalName Ina@contoso.com | Select PasswordNeverExpires