22. March 2013 · Comments Off on [Office365] Disable the requirement for strong password using PowerShell · Categories: Office365 · Tags: , ,

images

 

To disable the requirement for strong password for users via Windows PowerShell, would you please take the following steps:

Step 1. Install the Office 365 cmdlets.

Step 2. Connect Windows PowerShell to Microsoft Online Service.

Step 3. Start Microsoft Online Services Module for Windows PowerShell as an administrator and connect to Microsoft Online Service with a global administrator account by running the following command:

Connect-MsolService.

To start PowerShell as an administrator, please right-click the Windows PowerShell shortcut, and then click Run As Administrator.

Step 4. Run the cmdlet to disable the strong password requirement:

Set-MsolUser  -UserPrincipalName  [UserPrincipalName] -StrongPasswordRequired $False

To set all users

Get-MSOLUser | Set-MsolUser -StrongPasswordRequired $False
—————–
For example:

Set-MsolUser  -UserPrincipalName  user1@abc.com -StrongPasswordRequired $False

Step 5. Reset user’s password by using the following command:

Set-MsolUserPassword –UserPrincipalName [UserPrincipalName]–NewPassword [NewPassword]
——————
For example:

Set-MsolUserPassword–UserPrincipalName user1@abc.com –NewPassword abc

====================================================================================================

Find out whether a password is set to never expire

 

  1. Connect to Windows PowerShell using your company administrator credentials.
  2. 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

 

Set a password to never expire

 

  1. Connect to Windows PowerShell using your company administrator credentials.
  2. Do one of the following:
    • To set the password of one user to never expire, run the following cmdlet by using the user principal name (UPN) or the user ID of the user:
      Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true
    • To set the passwords of all the users in an organization to never expire, run the following cmdlet:
      Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

 

Set a password to expire

 

  1. Connect to Windows PowerShell using your company administrator credentials.
  2. Do one of the following:
    • To set the password of one user so that the password does expire, run the following cmdlet by using the user principal name (UPN) or the user ID of the user:
      Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $false
    • To set the passwords of all users in the organization so that they do expire, use the following cmdlet:
      Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $false

Comments closed.