PowerShell : change local Administrator password -


logged-in $computername local administrator windows server 2008 r2 sp1

this script :

$admin=[adsi]("winnt://" + $computername + "/administrator, user") $admin.psbase.invoke("setpassword", $password) $admin.psbase.commitchanges() 

run locally throws exception : exception calling "invoke" "2" argument(s):"the network path not found"

have not tested found

([adsi]“winnt://<local or remote computer name>/<username>”).setpassword(“<password>”) 

http://www.petri.co.il/how-to-change-user-password-with-powershell.htm


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -