Set Office365 user passwords to never expire

This is generally not recommended as it is a good idea to change your important password every so often, it will make hacker job more difficult.  However in some cases, it might be help.

Anyway, this post is referring back to a Microsoft article, so if you need more details information, use this link here Office Online

 

Set a password to never expire

The Use Windows PowerShell cmdlets to manage your Windows Azure AD tenant topic tells you how to install Windows Powershell and gives you more information about Windows Powershell and cmdlets.

  1. Connect to Windows PowerShell by using your company admin credentials. Run the following cmdlet:

Connect-MsolService

  1. Do one of the following:
    • To set the password of one user to never expire, run the following cmdlet by using the UPN or the user ID of the user:

      Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true

    • To set the passwords to never expire for all the users in an organization, run the following cmdlet:

      Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

Check out Set a user’s password expiration policy to set user passwords to expire after a specified amount of time.

Find out whether a password is set to never expire

  1. Connect to Windows PowerShell by using your company admin credentials. Run the following cmdlet:

Connect-MsolService

  1. Do one of the following:
    • To see whether a single user’s password is set to never expire, run the following cmdlet by using the user principal name (UPN) (for example, april@contoso.onmicrosoft.com) or the user ID of the user you want to check:

      Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires

    • To see the “Password never expires” setting for all users, run the following cmdlet:

      Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

Leave a Reply

Your email address will not be published. Required fields are marked *