0 out of 3 rated this helpful - Rate this topic

Configure user passwords to never expire

Published: April 16, 2012

Updated: February 28, 2013

Applies To: Office 365, Windows Intune

noteNote
This topic provides online help content that is applicable to multiple Microsoft cloud services, including Windows Intune and Office 365.

As a global administrator for a Microsoft cloud service, 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 synchronization roadmap.

To use Windows PowerShell cmdlets, you first must install them.

What do you want to do?

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, aprilr@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

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.