Set Office 365 Administrator Password To Never Expire

In this article I’ll show you how set my Office 365 Administrator password to never expire.

The reason I’m doing this Is because I’m running many scripts that auto connect to Office 365 and generate reports.

Like always, before you start, Install the Windows PowerShell Module for Office 365 and connect to Office 365 using PowerShell.

First connect to Office 365 using:

Connect-msolnline

To set the password to never expire run:

Set-MsolUser -UserPrincipalName admin@name.onmicrosoft.com -PasswordNeverExpires $true

To check If it’s working use:

Get-MSOLUser -UserPrincipalName name@name.onmicrosoft.com | Select PasswordNeverExpires | ft -AutoSize


Posted

in

by