2

Posted by Michael Alfaro on December 7, 2011

Disable password policy settings in BPOS and Office 365 with PowerShell-PasswordNeverExpires

We switched to Office 365 about 90 days ago, and it’s been working great.  Now we’re running into the 90 day default password policy from Microsoft which we want to avoid.  We found how to turn off the policy for all current members of our 365 subscription.  Here’s the original source: http://blog.atwork.at/post/2011/10/30/Passwordneverexpire-Kennwortrichtlinie-andern-in-BPOS-und-in-Office-365-mit-Hilfe-von-PowerShell.aspx

“Office 365 has a password policy, which is by default set to expire on a regular basis (90 days). There are some guidelines which help to make sure that the password is secure:

  • Use 8 to 16 characters
  • combination of upper- and lowercase letters
  • at leat one numer or one symbol (be aware that the symbol is available in every language on every keyboard)
  • Do not use spaces, tabs, line breaks, your user name

Each user is able to change his password at any time. If a user forgets his password it can be reset by an Office 365 administrator.

In some cases – for example for service accounts – it is useful to change the password expiration policy to never expire.

In this post I will show you how you can disable the password expiration for Office 365 and for BPOS as well.

Password Policy change to never expire in Office 365

In office 365 you need only two lines to disable the password policy. First open the Microsoft Online Services Modul for Windows Powershell. (Download: 32bit or 64bit).

Connect to Office 365

Connect-MsolService

In the dialog enter the credentials of an administrator:




To change a single user:

Set-MsolUser -UserPrincipalName <username> -PasswordNeverExpires $True

To change all users at once:

Get-MsolUser | Set-MsolUser -PasswordNeverExpires $True




That’s it. You can control the result with the following command:

Get-MsolUser | fl

Topics: , , ,

Add a Comment



 

Showing 2 Comments

  1. Brian

    I’ve been using this PowerShell command for a few weeks and it was working fine. Suddenly in the past few days it no longer seems to be able to connect to MsolService. No commands recognize that script.

    Have you had any trouble lately or is the password never expire script working as it always has?

    Nice post and thanks,
    Brian

  2. Michael Alfaro

    Hi Brain,

    I double checked and it seems to be working. We got a list of the users on the left and on the right the PasswordNeverExpires were all set to True.

    We just tried in the last hour so it is working. How are you logging into the Powershell?

    Mike