This article will show you how to configure a user password to never expire on the Office 365 platform.
First you will need the PowerShell cmdlets installed onto your computer. To install them, please follow the instructions here:
http://onlinehelp.microsoft.com/en-us/office365-enterprises/2b09b6a8-ad7e-446f-b7f0-273856beed70#BKMK_install
To connect Windows Powershell to Office 365, run the following cmdlet from the Powershell window (which you installed in the above step).
$cred=Get-Credential
After running that command, you will get a login window. Type in an "admin" level user for Office 365 (in the format of username@domain.com) and select "Ok".
Next, run the following cmdlet:
connect-MSOLService -credential $cred
If it connects successfully, no messages will be should be shown, just a new line as shown in the above screenshot.
If the credentials you've provided are incorrect, you will get a screen like the one above. If this happens, check your credentials and re-run the cmdlets above.
To see whether a single user’s password is set to never expire, run the following cmdlet by using the user ID (in the format of username@domain.com) of the user you want to check:
Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires
The result of the cmdlet will show if this flag has been set or not for this user. An example of this can be seen in the above screenshot. For this particular user, it has not been set.
Optional -- To see the "Password never expires" setting for all users, run the following cmdlet:
Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
To set the password of one user to never expire, run the following cmdlet by using the user ID of the user (in the format of username@domain.com):
Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true
Optional -- To set the passwords of all the users in an organization to never expire, run the following cmdlet:
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
To set the password of one user so that the password does expire, run the following cmdlet by using 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