Office 365 Disable Password Expiration / Stop Passwords from Expiring

Discussion in 'Windows Guides' started by InsaneNutter, Apr 15, 2014.

  1. InsaneNutter

    InsaneNutter Resident Nutter Staff Member

    Joined:
    Jun 1, 2007
    Messages:
    11,517
    Likes Received:
    3,444
    Location:
    Yorkshire, England
    Why would you want to do disable Password Expiration for Office 365 for Office 365 users? Surly its more secure to have users change passwords every 90 days?

    disable-office-365-password-expiration-1.png

    Yes that’s true, however if you have Office 365 synced with Active Directory on your domain chances are you have a password policy set-up anyway, so when the user changes their domain password it will sync to Office 365.

    To disable Disable Password Expiration for Office 365 you need to install the following:


    For both of the above Download the 32bit or 64bit version, depending on the operating system your using.

    When installed you should now have a “Windows Azure Active Directory Module for Windows PowerShell” either in your start menu / screen, or as a shortcut on the desktop. This is what you want to use to disable password expiration in Office 365, not the standard Windows Powershell.

    disable-office-365-password-expiration-2.png

    When you have loaded up the Windows Azure Active Directory Module for Windows PowerShell simply type the following:

    Code:
    connect-MSOLService -credential $cred
    You will then be asked to type in the credentials of an Office 365 administrator account:


    disable-office-365-password-expiration-3.1.png

    Once you are authenticated simply type:

    Code:
    Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

    disable-office-365-password-expiration-4.1.png

    This will turn off password expiration for all of your Office 365 accounts, you should not be required to do this for any new accounts created at a later date.

    How can i check this has worked?

    To view all the user accounts on your Office 365 subscription, along with if the users password is set to expire or not, run the following command:

    Code:
    Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires
    office-365-check-passwords-expire.png

    It is also possible to check the password expiration status for individual accounts with the following command:

    Code:
    Get-MSOLUser -UserPrincipalName user@domain.com | Select PasswordNeverExpires
    office-365-check-passwords-expire-2.png

    Note: After doing this if you have any passwords that are bugging you about expiring soon you might have to change them to stop the notifications, however after that you should not be bothered any more.
     
    Rick likes this.

Share This Page