Skip to the main content.

1 min read

Change Office 365 Password Expiration and Policy

In Office 365, the default password policy requires users to change their password every 90 days.  To some users this is a ridiculously short period of time, but to some administrators this is too long.  You can work it out between your users and your security team what the right time period is for password expiry, but here are some ways of changing this in Office 365.

To perform these configurations you will need the MS Online PowerShell cmdlets: http://onlinehelp.microsoft.com/office365-enterprises/hh124998.aspx

 

 

Disable Password Expiry all together:

  1. Open the Microsoft Online Services Module for Windows Powershell
  2. Run the following cmdlets to connect Windows PowerShell to Office 365$creds=Get-Credentialconnect-MSOLService -credential $creds
  3. You can get a list of your users by running the following cmdlet.  I recommend running this first because you need to user the UserPrincipalName when running the set cmdlet:Get-MsolUser
  4. Run the following cmdlet to set the password to never expire using the users’ UserPrincipalName:Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true

Eventually, you will become the target of some hacker or bot and your password will be compromised, so I do not recommend this approach.  Instead consider changing the password policy.

 

Change Password Policy Expiry Period and Notification Days:

To change the password policy:

  1. Open the Microsoft Online Services Module for Windows Powershell
  2. Run the following cmdlets to connect Windows PowerShell to Office 365.  When prompted, enter the credentials of an administrator of your tenant in Office 365.$creds=Get-Credentialconnect-MSOLService -credential $creds
  3. Run the following cmdlet to change the password policy:Set-MsolPasswordPolicy –ValidityPeriod <days> –NotificationDays <days> –DomainName <domain>
  • ValidityPeriod: Number of days before passwords expire
  • NotificationDays: Number of days warning the user will receive before being required to change password.
  • DomainName: A valid domain associated with your tenant.
FIDO2 Security Key for Windows 10 (Part 1)

FIDO2 Security Key for Windows 10 (Part 1)

FIDO2 Security Key for Windows 10 (Part 1) As companies like Yubico announce the next generation of YubiKeys with biometrics, let’s take a look at...

Read More
Enforcing Passwordless Logins with AADJ Windows 10 and Endpoint Manager Intune (Part 2)

Enforcing Passwordless Logins with AADJ Windows 10 and Endpoint Manager Intune (Part 2)

Enforcing Passwordless Logins with AADJ Windows 10 and Endpoint Manager (Intune) In the last blog post, we enabled FIDO2 security key logins with...

Read More

1 min read

Find out when your Password Expires

Few weeks ago I came across this question “How to find out an account’s password expiration date” in one of our internal mailing-list. This looks...

Read More