If you have company requirements to set some individual user passwords to never expire, you need to use Windows PowerShell. You can't do this in the Office 365 admin center.
If you're new to Windows PowerShell, you can do this! The PowerShell commands used in this article will only change a person's password expiration.
You can only do these steps on user accounts that aren't synchronized through directory synchronization.
Install the 64-bit version of the Microsoft Online Services Sign-in Assistant: Microsoft Online Services Sign-in Assistant for IT Professionals RTW.
Install the 64-bit version of the Windows Azure Active Directory Module for Windows PowerShell with these steps:
Open the Azure Active Directory Connection web page.
In Files in Download at the bottom of the page, click Download for the AdministrationConfig-V22.214.171.124-GA.msi file, and then install it.
Open Windows PowerShell as an administrator:
In your search bar, type Windows PowerShell.
Right-click on Windows PowerShell and select Run as Administrator.
The Windows PowerShell window will pop open. The prompt C:\Windows\system32 means you opened it as an administrator.
As a best practice, we recommend installing the latest AzureADPreview module. Type the following command at the PowerShell prompt:
At the message about an untrusted repository, type Y.
If you already have AzureADPreview installed, see the Update preview version of Azure Active Directory Module for Windows PowerShell about how to uninstall the old version and get the new one. Otherwise, you're ready to go!
If you haven't already, open a Windows PowerShell window on your computer (it doesn't matter if it's a normal Windows PowerShell window, or one you opened by selecting Run as administrator).
Run the following command:
In the Sign in to your account page that opens, sign in with your Office 365 admin account, and click Sign in.
Run the following command to set the password of one user to never expire:
Set-MsolUser -UserPrincipalName <name of the account> -PasswordNeverExpires $true
For example, if the name of the account is Ina@contoso.com, you'd type the command like this:
Set-MsolUser -UserPrincipalName Ina@contoso.com -PasswordNeverExpires $true
If you get a red error message, there's probably a typo or an extra space. Try again! Or, copy and paste the above to the PowerShell prompt, and use the arrow key to erase <name of the account> and enter the real name of the account.
In the Sign in to your account page that opens, enter your admin credentials to connect to the service, and click Sign in.
Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires
For example, to see the status for Ina@contoso.com, you'd type the following:
Get-MSOLUser -UserPrincipalName Ina@contoso.com | Select PasswordNeverExpires
The following picture shows how I set the password to never expire, and then ran the command to verify it is now set to never expire:
![This picture shows the commands to set the password to never expire, and then verify it was set.](../media/c0972196-5f4c-4f93-9ac9-15321eec5fdb.png)
The AzureADPreview module is required for a lot of procedures. As a best practice, we recommend always staying current: uninstall the old AzureADPreview version and get the latest one before you run PowerShell commands.
At the message about an untrusted repository, type Y. It will take a minute or so for the new module to install.
Zendesk Theme Designed by Diziana
Copyright © Diziana. All Rights Reserved