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 or interface, but you can do it o Windows PowerShell Microsoft Online Service

Below steps are required once on your computer, not every time you connect. However, you’ll likely need to install newer versions of the software periodically.

Step 1: Install Microsoft Online Services Sign-In Assistant

  1. Install the 64-bit version of the Microsoft Online Services Sign-in Assistant: Microsoft Online Services Sign-in Assistant for IT Professionals RTW.
  2. Install the Microsoft Azure Active Directory Module for Windows PowerShell with these steps:
    • Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).
    • Run the Install-Module AzureADPreview command.
    • If prompted to install the NuGet provider, type Y and press ENTER.
    • If prompted to install the module from PSGallery, type Y and press ENTER.
Install-Module AzureADPreview

Install-Module AzureADPreview

Step 2: Connect to Azure AD for your Office 365

  1. 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).
  2. Run the following command:
    Connect-MsolService

    Sign in to connect Microsoft Service Online

    Sign in to connect Microsoft Service Online

  3. In the Sign in to your account page that opens, sign in with your Office 365 admin account
  4. Run the following command to set the password of one user to never expire:
    Set-MsolUser -UserPrincipalName <email_account> -PasswordNeverExpires $true

When you’re successful, the PowerShell prompt appears for the next command. It doesn’t display anything like “done” or “success.”

You can also find out whether a user’s password is set to never expire by following command

Get-MSOLUser -UserPrincipalName <email_account> | Select PasswordNeverExpires