Hello,
I am looking for a script to reset the password of all computer accounts in the domain.
Can anyone help with this please?
Thanks
Hello,
I am looking for a script to reset the password of all computer accounts in the domain.
Can anyone help with this please?
Thanks
Hello @Ibrahim-Doucoure ,
You can use the following PowerShell script to reset the password on a remote computer.
$cred = Get-Credential
Invoke-Command -ComputerName "Server01" -ScriptBlock {Reset-ComputerMachinePassword -Credential $using:cred}
To reset the password on all computers in the domain (are you sure about that?) you could create a script that returned a list of all computer accounts in the domain (Get-ADComputer) and pipe the results into the above script.
I would recommend filtering the list of computers to a specific OU or set of test computers first, to make sure it works properly before running anything against all computers in the domain (especially DCs and FSMO role holders, etc) Resetting the password could end up breaking the trust relationship with the domain if it goes wrong.
What is the use case for wanting to reset all computer passwords?
Mike Rodrick
Edutainer, ITProTV
**if the post above has answered the question, please mark the topic as solved.
@Mike-Rodrick said in Password reset for all computer accounts in the domain:
$cred = Get-Credential
Invoke-Command -ComputerName "Server01" -ScriptBlock {Reset-ComputerMachinePassword -Credential $using:cred}
Hello,
Thanks you Mike.
Ibrahim.
Glad to help!
Mike Rodrick
Edutainer, ITProTV
**if the post above has answered the question, please mark the topic as solved.