The default password expiration policy of Office 365 is set to 90 days. That means that users have to change their password every 90 days. I think basically this is a good and secure policy but on the other side, it can be annoying and maybe your company has an other security policy or for some other reason you have to deactivate/change this.
We can change this setting through PowerShell with the Microsoft Online PowerShell Module.
- First connect to Office 365 via PowerShell more on this here. Consider, you need administration privileges to change account settings for other users..
- To get a list of the Microsoft Online Office 365 users:
- To get the details for a user:
Get-MsolUser -UserPrincipalName firstname.lastname@example.org
- Now you can use the following cmdlet to change the password policy for the password to never expire..
Set-MsolUser –UserPrincipalName email@example.com –PasswordNeverExpires $true
and if you’re a freak like me
Get-MsolUser | Set-MsolUser -PasswordNeverExpires $true
That will change the password policy for all users – have phun!