Home
Home    Sign-in and passwords    Configure user passwords to never expire

Configure user passwords to never expire

 

Topic Last Modified: 2013-03-25

As a global administrator for Microsoft Office 365 for enterprises, you can use the Windows Azure Active Directory Module for Windows PowerShell to set up user passwords to never expire. You can also use Windows PowerShell cmdlets to remove the never-expires configuration, or to see which user passwords are set up to never expire.

noteNote:
Only passwords for user accounts that are not synchronized through directory synchronization can be configured to never expire. For more information about directory synchronization, see the list of topics in Directory integration services.

If you would prefer to set user passwords to expire after a longer period of time rather than never expiring, you can set a password expiration policy for your users. You can set an expiration length of 14 to 730 days. For more information, see Set a user's password expiration policy.

To use Windows PowerShell cmdlets, you first must install them. If you have not already installed them, see the instructions in Use Windows PowerShell to manage Office 365.

To learn more about Windows PowerShell see Getting Started with Windows PowerShell. To learn more about managing Office 365 by using Windows PowerShell cmdlets, see Use Windows PowerShell to manage Office 365.

Find out whether a password is set to never expire

  1. Connect to Windows PowerShell using your company administrator credentials.

  2. 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
    • 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

  1. Connect to Windows PowerShell using your company administrator credentials.

  2. 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

  1. Connect to Windows PowerShell using your company administrator credentials.

  2. 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
See Also

Concepts

Reset a user's password

 

Arrow Was this article helpful? Tell us what you think
Microsoft
©2014 Microsoft Corporation
|