Office 365 - Set up user passwords to never expire

Xavier Mustin

Administrator
Staff member
#1
As an Office 365 admin of an Office 365 Enterprise or Office 365 Midsize organization, you may have company requirements to configure some user passwords to never expire. We don’t recommend that you set your user account passwords to never expire. We recommend setting passwords to never expire for service accounts, such as the account used for Active Directory synchronization.
If you’d prefer to set your user account passwords 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 your users. Check out Set a user's password expiration policy for details on how to do it.
If you do still need to set a password 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?
Set a password to never expire

The Use Windows PowerShell cmdlets to manage your Windows Azure AD tenant topic tells you how to install Windows Powershell and gives you more information about Windows Powershell and cmdlets.
  1. Connect to Windows PowerShell by using your company admin credentials. Run the following cmdlet:
Connect-MsolService
  1. Do one of the following:
  • To set the password of one user to never expire, run the following cmdlet by using the UPN or the user ID of the user:
Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true
  • To set the passwords to never expire for all the users in an organization, run the following cmdlet:
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
Check out Set a user's password expiration policy to set user passwords to expire after a specified amount of time.
Find out whether a 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
  • To see the "Password never expires" setting for all users, run the following cmdlet:
Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
 
Haut