View, enable or disable password cycle in Office365

For the login credentials for connection to Microsoft Exchange Online using PowerShell, Please review the information below and update the Service Request in the Microsoft Online Portal to confirm if the information provided resolves your issue.

 

1.       Connect to Exchange Online by using Windows PowerShell:

a.       Click Start, and then click All Programs.

b.      Click Accessories, click Windows Azure PowerShell, and then click Windows PowerShell.

c.       Run the following command:

Connect-MsolService

 

Find out whether a password is set to never expire

To see whether a single user’s password is set to never expire, run the following cmdlet by using the user principal name (UPN) (for example, [email protected]) or the user ID of the user you want to check: Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires

To see the "Password never expires" setting for all users, run the following cmdlet: Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

Set a password to never expire

Connect to Windows PowerShell using your company administrator credentials.

Do one of the following:

To set the password of one user to never expire, run the following cmdlet by using the user principal name (UPN) or the user ID of the user: Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true

To set the passwords of all the users in an organization to never expire, run the following cmdlet: Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

Set a password to expire

Connect to Windows PowerShell using your company administrator credentials.

Do one of the following:

To set the password of one user so that the password does expire, run the following cmdlet by using the user principal name (UPN) or the user ID of the user: Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $false

To set the passwords of all users in the organization so that they do expire, use the following cmdlet: Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $false