Office 365 and Password Never Expires

Andreas Lännerberg Office 365, Quick Tips 2 Comments

Office 365 has a default password policy which is applied to all users. This is a good practice but could pose some problems with the Meetio Service Account, especially if you have a policy with a short period before requiring the user to change the password.

If you want to exempt the Meetio Service Account from the default password policy it is not possible to do through Office 365 Admin portal, but it is possible to do it through Remote Powershell against Azure Active Directory (which Office 365 is based on).

To do so you need to install Azure Active Directory Module for Windows Powershell through the PowerShell command (in an elevated command prompt)

Install-Module -Name AzureAD

Then you need to supply your credentials (you need to be Office 365 Global admin)

$AzureAdCred = Get-Credential

With them you connect to Azure Active Directory with the command

Connect-AzureAD -Credential $AzureAdCred

After that you set the password to never expire through with the command

Get-AzureADUser -Filter "userPrincipalName eq ''" | Set-AzureADUser -PasswordPolicies DisablePasswordExpiration


About the Author

Andreas Lännerberg

CEO @ Meetio.

Share this post

Comments 2

  1. Thanks for this. I have a Nintex workflow that uses a cloud account to run a Query Office 365 User Profile Action. Anyway I needed to disable Password expiration. Thanks to you this now the case
    My syntax was a bit different thos ( ignoring the spaces below)
    Get-AzureADUser -Filter “UserPrincipalName eq ‘myaccont @'”

    1. Post

      Hi Daniel,

      It seems like -SearchString doesn’t work sometimes for some users for some reason. It is in the official documentation however so it should work. We have updated the article as it seems like -Filter always works. Thank you for your input!

Leave a Reply

Your email address will not be published. Required fields are marked *