Skip to content

/commands/active-directory/set-adaccountpassword-reset

Set-ADAccountPassword -Reset: reset an Active Directory user password with PowerShell

The commands on this page have not been executed by our verification runner yet.updated
tool
Active Directory PowerShell
versions
ActiveDirectory module (RSAT), Windows Server 2016-2025
os
windows

To reset a user's password in Active Directory with PowerShell, run Set-ADAccountPassword -Identity USER -Reset -NewPassword (Read-Host -AsSecureString 'New password'), then Set-ADUser -Identity USER -ChangePasswordAtLogon $true so the user picks their own password at the next logon. Both cmdlets are in the ActiveDirectory module that comes with RSAT or a domain controller.

powershell
Import-Module ActiveDirectory
$new = Read-Host -AsSecureString 'New password for adele'
Set-ADAccountPassword -Identity adele -Reset -NewPassword $new
Set-ADUser -Identity adele -ChangePasswordAtLogon $true
Unlock-ADAccount -Identity adele      # only if the account is locked out

Replace adele with the user's sAMAccountName, distinguished name, GUID or SID. The cmdlet prints nothing on success; add -PassThru to get the account object back.

Parameters

ParameterMeaning
-IdentityThe account: distinguished name, GUID, SID or sAMAccountName; also accepts objects from Get-ADUser or Search-ADAccount on the pipeline
-ResetReset without the old password; requires -NewPassword
-NewPasswordSecureString with the new password
-OldPasswordSecureString with the current password, for a change rather than a reset
-ServerDomain or domain controller to send the change to
-CredentialRun as another account that has the reset right
-PassThruReturn the modified account object

If you leave out both password parameters, the cmdlet prompts for the current and the new password interactively, so scripts should always pass -NewPassword.

Reset several accounts

powershell
Import-Csv .\reset.csv | ForEach-Object {
  $pw = ConvertTo-SecureString $_.TempPassword -AsPlainText -Force
  Set-ADAccountPassword -Identity $_.SamAccountName -Reset -NewPassword $pw
  Set-ADUser -Identity $_.SamAccountName -ChangePasswordAtLogon $true
}

Requirements and limits

  • The account running the command needs the Reset password permission on the target object, for example as a domain administrator or through delegated control on the user's OU. Without it, Microsoft's reference says the module returns a terminating error.
  • The new password must satisfy the domain password policy (length, complexity, history), or the domain controller rejects it.
  • Microsoft notes that the cmdlet does not work against a read-only domain controller, an AD snapshot, or the global catalog port.
  • Group managed service accounts cannot have their password set; Windows changes it on a schedule.
  • For users synced to Microsoft Entra ID, reset the password in AD; for cloud-only accounts use Update-MgUser -PasswordProfile.

Errors

MessageMeaning
The term 'Set-ADAccountPassword' is not recognized...The ActiveDirectory module is not installed or not imported
Cannot find an object with identity: 'adele'...Wrong name, or the account is in another domain (use -Server)

Fixes: Get-ADUser is not recognized (the same module), Cannot find an object with identity, and installing RSAT on Windows 11. The module works in Windows PowerShell 5.1 and, on Windows, in PowerShell 7.

FAQ

What is the difference between -Reset and changing a password?

-Reset sets a new password without knowing the old one, which needs reset-password rights on the account. Without -Reset you pass -OldPassword and -NewPassword, as the user would when changing their own password.

Why does Set-ADAccountPassword reject my plain-text password?

-NewPassword and -OldPassword are SecureString parameters. Read the value with Read-Host -AsSecureString, or convert it with ConvertTo-SecureString -AsPlainText -Force.

How do I make the user change the password at next logon?

Run Set-ADUser -Identity USER -ChangePasswordAtLogon $true after the reset. Set-ADAccountPassword itself has no parameter for it.

Sources