Office Support / Office 365 Admin / Users and passwords

Set an individual user's password to never expire

As an Office 365 admin, you may have company requirements to configure some individual user passwords to never expire. If you’d prefer to set your all user passwords to never expire or to expire after a longer period of time (a maximum of 730 days), rather than never expiring, you can set a password expiration policy for all your users. Check out Set a user's password expiration policy for details on how to do it.

Watch: How to set up passwords to never expire

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.
Video on how to set up user passwords to never expire

If your company requirements don't allow you to set all user passwords to never expire, but you still need to set a password on an individual user to never expire, you must complete this relatively complex task using Windows PowerShell.

Important   Only passwords for user accounts that aren’t synchronized through directory synchronization can be set to never expire. Check out Directory integration for Microsoft Azure Active Directory for more details.

Prior to November 1st 2013, the Office 365 portal could only set the password policy in the default onmicrosoft.com domain. Now the Office 365 portal changes password policy for all domains. If you made password policy changes prior to November 1st, we recommend that you set the policy again to apply the policy to all of your custom domains. Check out Set a user's password expiration policy for details on how to do it.

What do you want to do?

Download and install Microsoft Azure Active Directory Module for Windows PowerShell

Set an individual user's password to never expire

Find out whether a password is set to never expire

What else to I need to know?

Download and install Microsoft Azure Active Directory Module for Windows PowerShell

Before you can run the cmdlet to set the password to never expire, you have to download and install a module that will let you talk to your Office 365 organization.

  1. Download and install the Microsoft Online Services Sign-In Assistant for IT Professionals RTW from the Microsoft Download Center. Download the 64bit version.

  2. Download and install the Azure Active Directory Module for Windows PowerShell (64-bit version). Click Run download and install. Check out the Use Windows PowerShell cmdlets to manage your Windows Azure AD tenant topic for more information about Windows Powershell and cmdlets.

Set a user's password to never expire

Run the following cmdlet to set the user password to never expire

  1. Connect to Windows PowerShell by using your company admin credentials. Run the following cmdlet:

    Connect-MsolService
  2. In the Enter Credentials page, enter your Office 365 global admin credentials. See Assigning admin roles for more info on roles in Office 365.

  1. After you enter your Office 365 credentials, do the following:

    • To set the password of one user to never expire, run the following cmdlet:

      Set-MsolUser -UserPrincipalName <serviceaccount@contoso.com> -PasswordNeverExpires $true

Check out Set a user's password expiration policy to set all user passwords to never expire or to expire after a specified amount of time.

Find out whether a user's password is set to never expire

  1. Connect to Windows PowerShell by using your company admin credentials. Run the following cmdlet:

Connect-MsolService

  1. Do one of the following:

    • 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, april@contoso.onmicrosoft.com) or the user ID of the user you want to check:

      Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires

What else to I need to know?

If you’re an admin of an Office 365 Small Business organization, you can set user passwords to never expire or to expire after a specified amount of time Check out Change how often passwords expire for details on how to do it.

Applies To: Office 365 End User, Office 365 Admin



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language