QuickTip: Change the local Administrator password on a remote server

To quickly change a password for any local administrator account, albeit locally or remote the following script can be used:

$account = [ADSI]("WinNT://server01/Administrator,user")
$account.psbase.invoke("setpassword",'Password1')

The WinNT provider allows for access to the SAM database on remote systems, assuming the account that executes this has the appropriate permissions to do so.

Share

Leave a Reply

Your email address will not be published.