(Cloud) Tip of the Day: Set password to never expire

Today’s (Cloud) Tip…

If you are using a service that uses Azure Active Directory as the identity platform such as Office 365, Intune, or Azure, you can set passwords of cloud managed users to never expire.

To do this, you will need to use Azure Active Directory Module for Windows PowerShell.

First install the Microsoft Online Services Sign-In Assistant for IT Professionals RTW from the Microsoft Download Center. Then install the Azure Active Directory Module for Windows PowerShell (64-bit version), and click Run to run the installer package.

Then perform the following steps…

  1. Open Azure Active Directory Module for Windows PowerShell
  2. Run the following cmdlet…
    Connect-MsolService
    Note When prompted, provide your global administrator credentials
  1. Determine which user you want to set the password to never expire and run the following cmdlet…
    Set-MsolUser -UserPrincipalName [UPN of user] -PasswordNeverExpires $True

For example, if you wanted to set the password to never expire for the global administrator account used for directory synchronization, the cmdlet will look something like this…

Set-MsolUser -UserPrincipalName dirsyncsvc@contoso.com -PasswordNeverExpires $True

If you wanted to change the password back to expiring, then use $False instead of $True for the PasswordNeverExpires parameter like so…

Set-MsolUser -UserPrincipalName dirsyncsvc@contoso.com -PasswordNeverExpires $False