Something we’re asked about is “how do I, with my office 365 set password to never expire?”
We recently migrated a client’s in-house Exchange mail server to Microsoft Office 365 hosted by Telstra. Overall, we found Office 365 was not as straightforward, nor as cheap, as Google Apps.
The client, however, was comfortable with their Exchange environment and happy to pay a premium over Google Apps. This client wanted to configure their Office 365 password to never expire. This could not be configured through the Microsoft Online Portal. It required configuring through the PowerShell command line.
Here’s the steps to do it:
Step 1 – Firstly, download and install Microsoft Online Services Module for Windows PowerShell. Download here.
Step 2 – Then, run Microsoft Online Services Module for Windows PowerShell.
Step 3 – Next, to connect to your Office 365 service, run this command:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Step 4 – After that, enter your Office 365 administrator username and password in the dialogue box.
Step 5 – Connect to the MSOL Service by running this command:
Connect-MsolService
Step 6 – (remember the original question – “how do I, with my office 365 set password to never expire?”). Set the password to never expire for all users:
C:\Users\Ryan\Desktop> Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
Step 7 – Finally, confirm that password is set to NEVER expire for all users:
C:\Users\Ryan\Desktop> Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
This should display something like:
UserPrincipalName PasswordNeverExpires
—————– ——————–
peter.johnson@somedomain.com.au True
admin@somedomain.onmicrosoft.com True
maria.smith@somedomain.com.au True
admin@somedomain.com.au True
Seems simple right? It’s not always the most obvious fix. However, there are often ways to configure settings to be more customised to the way you do business.
If you have further questions about this topic or any of our other services, call us to chat – anytime!