Jan 24, 2012

Office 365 password expired - How to disable 90 day password expiration

I ran into an issue with my first Microsoft Office 365 cloud hosted deployment.  I went to go log in as the administrator to work on an issue and I found that my password had expired.  I then discovered that by default, all user passwords are set to expire every 90 days.  If you don't want such a policy, it IS possible to disable.  Though you won't find the settings anywhere in the Admin portal GUI.  You'll need to use some PowerShell scripts.

You'll need a few tools installed on your workstation in order to get Powershell working.

Microsoft Online Services Sign-In Assistant

32-bit download
64-bit download

Microsoft Online Services Module for Windows PowerShell

32-bit download
64-bit download

Now that you have the tools in place, launch PowerShell but going to Start -> All Programs -> Microsoft Online Services -> Microsoft Online Services Module for Windows PowerShell.

Now to you need connect and log in to your Office 365 account with PowerShell.  Type the following command in the PowerShell window...


Then you'll see a login window. Enter your Office 365 username and password.

Now you can disable the password expiration for all users in your Office 365 domain with this command...

Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

If you'd like to make the change for just a single user, you can use the script below (replacing user@mydomain.com with the proper user's email address.)

Set-MsolUser -UserPrincipalName user@mydomain.com -PasswordNeverExpires $true

You won't get any confirmation or anything, but as long as PowerShell doesn't give you an error, then you've done it correct.

Update : One important thing I've discovered is that this script doesn't disable the password expiration for the entire system once and for all - it's only disabling it for the user(s) that you specify that exist right now.  So if you create a new user tomorrow, I believe that users password will expire in 90 days by default.  So you'll need to run this script each time you create a new user account!


Anonymous said...

Thank you

Anonymous said...


Anonymous said...

Have you had any issues with passwords expiring even after you have successfully run the powershell commands?

Anonymous said...

Thank you Thank you!!! I have an update. The two downloads you'll need from the Microsoft Download Center are "Microsoft Online Services Sign-In Assistant for IT Professionals RTW" and "Azure Active Directory Module for Windows Powershell". The Azure install has the Windows Powershell cmdlets for Office365. The Syntax for the short scripts to disable password policy remain the same. Again, thanks...Steven

Fangyaya said...

cheap ray ban sunglasses
tory burch flats
abercrombie & fitch outlet
louis vuitton bags
celine outlet
michael kors outlet
ugg boots
mbt shoes
cheap beats headphones
coach outlet store online
louis vuitton
retro jordan shoes
lebron 13 shoes
kate spade outlet
jordan 3 powder blue
michael kors outlet online
ugg slippers
adidas factory outlet
michael kors outlet
michael kors handbags
rolex watches
louis vuitton purses
coach outlet clearance
timberland shoes
polo ralph lauren
canada goose jackets
louis vuitton outlet
ugg boots
ugg boot uk
ladies cartier watches
nike roshe one
gucci outlet online
ralph lauren polo
coach outlet store
cheap true religion
louis vuitton outlet
uggs on sale
michael kors outlet online
christian louboutin outlet

Cara menyembuhkan gerd said...

given article is very helpful and very useful for my admin, and pardon me permission to share articles here hopefully helped :

Suplemen untuk mengatasi efek racun kosmetik berbahaya
Obat kista ganglion ampuh
Apotik di pangandaran yang menjual obat qnc jelly gamat
Obat tradisional penyakit dompo
Cara menyembuhkan dermatitis kontak
Cara menyembuhkan abses payudara
Obat gabagen

Autopilot White Glove error message We couldn't find any Provisioning Packages

I was testing out the Windows Autopilot "White Glove" feature this week.  This is a new feature of the Intune AutoPilot service th...