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