HOWTO Set an individual user’s password to never expire in Office365

Most organization have a policy to expire password after 90 days, commonly use in information security risk management to setup an accounts. But we also need to create an account with no password expiration because of it’s function in the server or created for specific service.

The step-by-step procedure will guide you on how you can accomplish this task.

Given the following information:

  • I’m using Office365 for email, sharepoint, etc.
  • Windows 10 Pro 64bit

Let’s start.

Step 01. In Windows 10 Professional, the Power Shell program  is available. In your search bar, type Windows PowerShell or simply PowerShell. When you see it right-click on Windows PowerShell and select Run as Administrator.

The PowerShell window ill pop open.

Step 02. Run Install-Module MSOnline command.

Step 03. Connect to your Office 365 subscription. To connect with your Office 365 administrator account. If will prompt you to enter your admin email address and password. In my case, I have to enter also my pin code because MFA is enabled.

$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential

Step 04. Now let’s set a user to never expire.

Run this command.

Set-MsolUser -UserPrincipalName <name of the account> -PasswordNeverExpires $true

For example, to see the status for, you’d type the following:

Set-MsolUser -UserPrincipalName -PasswordNeverExpires $true

Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires

For example, to see the status for, you’d type the following:

Get-MSOLUser -UserPrincipalName | Select PasswordNeverExpires

That’s it.

If you have a follow questions, please use our Forum or the form below to post your comment.


Images from website.


  1. Connect to Office 365 PowerShell –
  2. Set an individual user’s password to never expire –

Support @QUE.COM

Founder, QUE.COM Internet Media. | Founder, a Shout for Joy! | MAJ.COM Management of Assets and Joint Ventures. More at KING.NET Ideas to Life.

Leave a Reply

AI Chatbot Avatar