Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to configure user passwords to never expire in Office 365


View products that this article applies to.

Introduction

This article describes how to set user passwords never to expire in Microsoft Office 365. You can use the Windows Azure Active Directory Module for Windows PowerShell to set user passwords to never expire.

Note This procedure does not apply to users who are enabled for single sign-on (SSO). This is because passwords for SSO-enabled users are managed in the on-premises environment. If you try to perform this procedure for an SSO-enabled user, you receive output that resembles the following in Windows PowerShell:

Set-MsolUser : Unable to update parameter. Parameter name: PasswordPolicies.
At line:1 char:13
+ Set-MsolUser <<<< -UserPrincipalName jsmith@contoso.com
-PasswordNeverExpires $true
+ CategoryInfo : OperationStopped: (:) [Set-MsolUser], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.PropertyNotSettableException, Microsoft.Online.Administration.Automation.SetUser

Note Only passwords for user accounts that are not synchronized through directory synchronization can be configured to never expire.

↑ Back to the top


Procedure

Check whether a password is set to never expire
To check whether a password is set to never expire, determine whether the PasswordNeverExpires setting is enabled or disabled for a user. To do this, follow these steps:
  1. Start the Windows Azure Active Directory Module for Windows PowerShell.
  2. Connect to Windows Azure Active Directory (Windows Azure AD) by using Windows PowerShell. For more info about how to do this, go to the following Microsoft website:
  3. Run the following cmdlet by using the user principal name (UPN) or the user ID of the user whom you want to check:
    Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires

    Or, to see all users and their PasswordNeverExpires setting, run the following cmdlet:
    Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
Configure a password to never expire
To set a user's password to never expire, enable the PasswordNeverExpires setting. To do this, follow these steps:
  1. Start the Windows Azure Active Directory Module for Windows PowerShell.
  2. Connect to Windows Azure AD by using Windows PowerShell. For more info about how to do this, go to the following Microsoft website:�
  3. Run the following cmdlet by using the UPN or the user ID of the user to configure the password to never change:

    Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true
    Note If you want to change the setting for all the users in a company, run the following cmdlet:
    Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
Configure a password to expire
To set a user's password to expire, disable the PasswordNeverExpires setting. To do this, follow these steps:
  1. Start the Windows Azure Active Directory Module for Windows PowerShell.
  2. Connect to Windows Azure AD by using Windows PowerShell. For more info about how to do this, go to the following Microsoft website:�
  3. Run the following cmdlet by using the UPN or the user ID of the user to disable the PasswordNeverExpires setting:
    Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $false
    Note If you want to change the setting for all the users in a company, run the following cmdlet:
    Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $false

↑ Back to the top


More information

For more information about�how to manage Windows Azure�AD by using Windows PowerShell,�go to the following Microsoft website:

↑ Back to the top



Still need help? Go to the Office 365 Community website.

↑ Back to the top


Keywords: o365, o365a, o365e, o365062011, pre-upgrade, o365022013, after, upgrade, o365p, o365m, KB2666768

↑ Back to the top

Article Info
Article ID : 2666768
Revision : 17
Created on : 5/17/2013
Published on : 5/17/2013
Exists online : False
Views : 658