- OpenVPN IPv6 and IPv4 configuration - Mon, Mar 1 2021
- 4sysops author and member competition 2020 - Fri, Jan 1 2021
- Assign an IPv6 address to an EC2 instance (dual stack) - Tue, Dec 15 2020
For some reason, the Office 365 web interface only allows to set the password expiration period to a maximum of 730 days. In the Office 365 admin center, click service settings > passwords.
Office 365 Password Expiration Policy
If you want to set the password expiration policy to never expire, you have to use PowerShell. Since I only need to change the password policy once a year or so, I always find myself googling again to collect the PowerShell cmdlets I need from different web pages. Time to write my own documentation.
This cmdlet connects you to Office 365. It is the same as for Windows Azure and Windows Intune. You’ll have to provide the credentials of an Office 365 admin account after you enter the command.
With the next command, you set the password expiration policy for a single user to never expire:
Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true
<user ID> is just the main email address of the mailbox.
To verify the new password policy has been set, you can use this command:
Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires
If you want to set the password policy to never expire for all accounts in your organization, you need this command:
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
And if you want to display the password expiration policy of all users, you have to use this one:
Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
Another question is if you reduce the security in your organization if you change the password policy to never expire. If you force your users to change their passwords too often, they will start sticking notes with their passwords on their monitors. In my view, it is better to force users to use strong passwords and work with a long password expiration period. Think of it this way. How much safer will you be if you change the locks of your house every two months or so.
What password expiration policy do you have in your organization?