How to configure user passwords to never expire in Office 365
How to configure user passwords to never expire in Office 365
There are two main steps of how to set user passwords to never expire:
Setup Office 365 PowerShell Management Interface
The Office 365 PowerShell Management Interface offers the ability to administer service-wide features, and is not limited to a specific service like i.e. Exchange Online. The initial features that can be administered using this interface include the following:
- Account SKUs
- Company info
- Contacts
- Domains
- Domain Federation
- Groups
- Partner Contracts
- Role-based Access Control
- Subscriptions
- Users
This interface is available through a PowerShell Module available from here:
- Microsoft Online Services Module for Windows PowerShell 32-bit
- Microsoft Online Services Module for Windows PowerShell 64-bit
The Microsoft Online Services Sign-In Assistant 7.0 is a prerequisite for installing the Microsoft Online Services Module for Windows PowerShell, and is available from here:
- Microsoft Online Services Sign-In Assistant 32-bit
- Microsoft Online Services Sign-In Assistant 64-bit
When installed you can launch Windows PowerShell and perform the following steps:
001 002 003 004 |
Import-Module msonline $cred = Get-Credential Connect-MsolService -cred $cred Get-Command –Module msonline |
1) Import the module.
2) Create a credential-object stored in the variable $credimp
3) Create a new remote PowerShell connection against the PowerShell endpoint for Office 365
4) List the cmdlets available
A shortcut to the module is also available on the Start-menu (you can skip step 1 if launching this shortcut):
Here is an overview of the available cmdlets:
Run command in Office 365 PowerShell Management Interface
For users who are not synchronized through directory synchronization
In Office 365, customers can use the Microsoft Online Services Module for Windows PowerShell (MOSMWP) to configure their user passwords to never expire. The following steps can be provided to customers who want to configure these settings for their users.
How to check if the "Password never expires" setting is enabled or disabled for a user
- Connect to the Microsoft Online Services Module for Windows PowerShell by using your company administrator credentials.
- Run the following command by using the user principal name (UPN) or the Microsoft Online Services ID of the user you want to check:
Get-MSOLUser -UserPrincipalName <Microsoft Online Services ID> | Select PasswordNeverExpires
Alternatively, to see all users and their "Password never expires setting", you can run the following PowerShell command:
Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
How to enable the "Password never expires" setting
- Connect to the Microsoft Online Services Module for Windows PowerShell by using your company administrator credentials.
- Run the following command by using the user principal name (UPN) or the Microsoft Online Services ID of the user to configure the password for that user to never change:
Set-MsolUser -UserPrincipalName <Microsoft Online Services ID> -PasswordNeverExpires $true
Note If you want to change the setting for all the users in an organization, run the following command:
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
How to disable the "Password never expires" setting
- Connect to the Microsoft Online Services Module for Windows PowerShell (MOSMWP) by using your company administrator credentials.
- Run the following command by using the user principal name (UPN) or the Microsoft Online Services ID of the user to disable the Password never expire setting for that user:
Set-MsolUser -UserPrincipalName <Microsoft Online Services ID> -PasswordNeverExpires $false
Note If you want to change the setting for all the users in an organization, use the following cmdlet:
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $false
For users who are synchronized through directory synchronization
The PasswordNeverExpires setting for synchronized users must be configured by using the steps earlier in this article. There is no Active Directory property that can be synchronized to Office 365 to set the PasswordNeverExpires setting.
For more information
https://onlinehelp.microsoft.com/en-us/office365-enterprises/hh125001.asp
https://onlinehelp.microsoft.com/en-us/office365-enterprises/hh534387.aspx
APPLY TO
- Microsoft Office 365 for enterprises
- Microsoft Office 365 for small businesses
Comments
Anonymous
April 23, 2013
The comment has been removedAnonymous
June 15, 2013
As of June 2013, this process no longer works. The "microsoft online services module", above, will download but not install.Anonymous
June 20, 2013
Actually, the process still works fine as given 6-20-13. Follow the steps exactly. I launched the Microsoft Online Services Module for PowerShell, and then input the commands there.Anonymous
August 16, 2013
"Connect to the Microsoft Online Services Module for Windows PowerShell by using your company administrator credentials" Can't bother yourself to mention how to do this?Anonymous
August 25, 2013
as of 25-Aug 2013, the steps above still works... only i find that the link download for the above "Microsoft Online Services Sign-In Assistant 64-bit" has some issues to Launch the PS. instead i got from another link download below for => Microsoft Online Services Sign-In Assistant for IT Professionals BETA www.microsoft.com/.../details.aspxAnonymous
October 21, 2014
Microsoft Online Services Module for Windows PowerShell 64-bit says it needs Microsoft Online Services Sign-In Assistant 64-bit 7.0 or newer. i can't install 7.0 as the version i have is .... newer.Anonymous
January 12, 2015
@KELA91
Thanks alot..the link you gave to download Microsoft Online Services Sign In Assistant for IT Professionals BETA..worked for me!
Thanks for sharing it!
Cheers!Anonymous
February 06, 2015
Same here. Beta did the trick. Thank you so much for this blog - it will save me countless headaches having to reset people's passwords to giving the illusion of never expiring :)