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 support@que.com, you’d type the following:
Set-MsolUser -UserPrincipalName support@que.com -PasswordNeverExpires $true
Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires
For example, to see the status for support@que.com, you’d type the following:
Get-MSOLUser -UserPrincipalName support@que.com | 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 Office.com website.
References:
- Connect to Office 365 PowerShell – https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-office-365-powershell
- Set an individual user’s password to never expire – https://support.office.com/en-us/article/set-an-individual-user-s-password-to-never-expire-f493e3af-e1d8-4668-9211-230c245a0466?ui=en-US&rs=en-US&ad=US