Solutions4IT Logo
Money Back Guarantee
6 Month Trial Period
Plain English IT Support
No jargon, no tricky words
Trustworthy & Reliable
4.9* Google Reviews
Happy clients
99% Customer Satisfaction
View Categories

How to set ‘Password Never Expires’ for 365 Account in PowerShell

< 1 min read

Please follow the below to change a password to never expire for an individual Microsoft 365 Account.
1. Install the AzureAD Module for Powershell:-

Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).
In the Administrator: Windows PowerShell command window, run this command:
Install-Module -Name AzureAD
If prompted about installing a module from an untrusted repository, type Y and press ENTER
(4 minutes)
2. Install the MSOnline Module for Powershell:-

Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).
In the Administrator: Windows PowerShell command window, run this command:
Install-Module -Name MSOnline
If prompted about installing a module from an untrusted repository, type Y and press ENTER
(3 minutes)
3. Run the following command and enter the Global Administrator credentials:-

Connect-MSOLService
(1 minute)
4. Run the following command:-

Set-MsolUser -UserPrincipalName "fullemailaddressofuser" -PasswordNeverExpires $true
(1 minute)
5. Run the following to obtain a list of all of the users and their current password expiry settings:-

Get-MsolUser | fl DisplayName, PasswordNeverExpires
(1 minute)

Powered by BetterDocs

Leave a Reply

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

© Copyright Solutions 4 IT Ltd 2026. All Rights Reserved. Terms & Conditions Privacy Policy