Office 365: Turn Password Reset Off

To anyone who has had Office 365 for 90 days or more, I am sure you have come to find it extremely useful. Especially to have the ability of having full control of your e-mail, no matter what computer or device you are using. But if you are like me and have also reached that 90 day checkpoint, then you have realised its time to change your password like it or not.

 I logged in on Saturday to check my e-mail only to have it ask me to change my password which I don’t like to do. And yes I know its good security measure to change your password but I don’t like to. Now after much research and reading through command list ontop of a lot of red text in powershell, I got it so that my account doesn’t change require I change my password.

 To do the following you have to use Powershell and if you are using Windows 7, you run it as administrator.If you are using Windows XP, you will have to download the Powershell program found here.

 What follows are the commands in order of how I put them in:

 (You can copy paste into powershell, when you right click in powershell it will paste whats in your clipboard automatically)

 Open Microsoft Online Services PowerShell

These commands will log you in to your account.

 Connect-msolservice

 If you have any problems with that command try running these first:

 $Cred = Get-Credential 

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $Cred -Authentication Basic –AllowRedirection

 Import-PSSession $Session

 Once you have successfully logged in, here are the commands to make the password never expire for individual users or an organization.

 

How to check if the “Password never expires” setting is enabled or disabled for a user

Connect to the Microsoft Online Services Module for Windows PowerShell by using your company administrator credentials.

 Run the following command by using the user principal name (UPN) or the Microsoft Online Services ID of the user you want to check:

Get-MSOLUser -UserPrincipalName <Microsoft Online Services ID> | Select PasswordNeverExpires

 Alternatively, to see all users and their “Password never expires setting”, you can run the following PowerShell command:

 Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

 

How to enable the “Password never expires” setting

Connect to the Microsoft Online Services Module for Windows PowerShell by using your company administrator credentials.

 Run the following command by using the user principal name (UPN) or the Microsoft Online Services ID of the user to configure the password for that user to never change:

Set-MsolUser -UserPrincipalName <Microsoft Online Services ID> -PasswordNeverExpires $true 

Note If you want to change the setting for all the users in an organization, run the following command:

 Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true 

 

How to disable the “Password never expires” setting

Connect to the Microsoft Online Services Module for Windows PowerShell (MOSMWP) by using your company administrator credentials. 

Run the following command by using the user principal name (UPN) or the Microsoft Online Services ID of the user to disable the Password never expire setting for that user:

Set-MsolUser -UserPrincipalName  <Microsoft Online Services ID> -PasswordNeverExpires $false

 Note If you want to change the setting for all the users in an organization, use the following cmdlet:

 Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $false