Set Office 365 Passwords to Never Expire
-
Originally posted in 2013 on my Windows Administration blog here: http://web.archive.org/web/20130929034913/http://www.scottalanmiller.com/windows/2013/05/20/set-office-365-passwords-to-never-expire/
You can do this user by user or with the following command to make all users on the account have never expiring passwords:
Get-MSOLUser | Set-MSOLUser -PasswordNeverExpires $true
You can output the status of all accounts like so:
Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
You can do this for an individual user too, of course:
Set-MsolUser -UserPrincipalName -PasswordNeverExpires $true
And verify an individual user:
Get-MSOLUser -UserPrincipalName | Select PasswordNeverExpires
Reference:
http://onlinehelp.microsoft.com/en-us/office365-enterprises/hh534387.aspx