Share via


Reset AD Computer Account via PowerShell

To reset a domain computer's account in Active Directory via PowerShell, run the following:

**On the domain controller: **

1.$typeComputerName=read-host –Prompt “Enter computer name to reset“
2.$typeCompPassword=read-host –Prompt “Enter random characters for temp password“ -AsSecureString
3.Get-ADComputer $typeComputerName | Set-ADAccountPassword –NewPassword:$typeCompPassword -Reset:$true

On remote computer:



  1.      $typeComputerName=read-host –Prompt “Enter computer name to reset“  
  2.      $typeCompPassword=read-host –Prompt “Enter random characters for temp password“ -AsSecureString  
  3.      $AdminCredentials = Get-Credential     "Domain01\User01"  
  4.      Get-ADComputer $typeComputerName -Credential $AdminCredentials -SearchScope Subtree -SearchBase     "DC=rootandadmin,DC=com" | Set-ADAccountPassword –NewPassword:$typeCompPassword -Reset:$true

This has the same affect as resetting the computer via Active Directory Users and Computers (ADUC) or Active Directory Administrative Center (ADAC).

Requirements: RSAT, appropriate domain permissions.