Change local administrator password on multiple computers

Open notepad and paste these script:

$computers = Get-Content -path C:computers.txt
$user = "administrator"
$password = "NewPassword@#"
Foreach($computer in $computers)
{
 $user = [adsi]"WinNT://$computer/$user,user"
 $user.SetPassword($Password)
 $user.SetInfo()
}

where computer.txt is txt file created in C: and contains all names of computers.

$user is username for which you want to change the password.

$password is new password you want to put for the user in all computers.

Save the script as .ps1 for example: changepasswd.ps1

open powershell with administrator rights

run the script .changepasswd.ps1

thats it 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s