PowerShell Password Reset AD

-Points:

  1. Open PowerShell as an administrator.

  2. Connect to your Active Directory domain by running the following command:

PowerShell
Import-Module ActiveDirectory
  1. Once you’ve imported the Active Directory module, you can reset the user’s password using the Set-ADAccountPassword cmdlet. For example, to reset the password for a user with the username “johndoe”, run the following command:
PowerShell
Set-ADAccountPassword -Identity johndoe -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "newpassword" -Force)

Replace “newpassword” with the new password you want to set for the user. You will be prompted to enter your own credentials for the domain administrator or a user with reset password permission.

  1. Finally, you can verify that the user’s password has been reset by running the following command:
PowerShell
Get-ADUser johndoe -Properties PasswordLastSet

This command will display the last time the user’s password was changed. If it was recently changed, then the password reset was successful.