In this article, I’ll show you how set an Administrator account password to never expire using the Office 365 PowerShell module.
In past, I’ve shown how to set the password not to expire using the new Office 365 PowerShell module (also known as V2).
However, currently, most organization are using version 1 of the module because V2 is not fully functional and doesn’t contain all the Office 365 cmdlet.
Connect to Office 365
Before we can set the password to never expire, we need to log in to Office 365 using PowerShell.
I’ll connect to Office 365 using a Global Administrator account
Once connected, I’ll use the cmdlet below to set an account called Admin to have is password never expire.
Set-MsolUser -UserPrincipalName firstname.lastname@example.org -PasswordNeverExpires $true
To check if the cmdlet worked the password never expire option is enabled I’ll use the cmdlet below.
Get-MSOLUser -UserPrincipalName email@example.com | Select PasswordNeverExpires | ft -AutoSize