PowerShell : change local Administrator password


Logged-in to $ComputerName as local Administrator Windows Server 2008 R2 SP1

This script :

run locally throws exception : Exception calling "Invoke" with "2" argument(s):"The network path was not found"


When I wanted to change local admin password accross all the servers in AD domain I simply used PS remoting which allows pushing even very basic commands from CMD to remote server.

I wrote a short script where I use powershell to obtain info from domain controller and based on certain conditions push command to the servers.

I find it as really easy and fast way how to change local admin password. The only requirement is to have WinRM enabled on all the servers.

The script is below here:


PowerShell : change local Administrator password by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply