Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230663

Re: Need script to change admin password for all VMs(windows)

$
0
0

One way of doing this is with the Invoke-VMScript cmdlet.

 

I assume that you have all the VMs where you need to change the administrator password in the variable $vms.

I also assume that your account has admin authority on all the guest OS.

 

Then you could do something like this

 

$script=@"
$localadministrator=[adsi]("WinNT://./administrator, user")
$localadministrator.psbase.invoke("SetPassword", "your-new-password")
"@


foreach($vmin$vms){
   
Invoke-VMScript-ScriptText$script-VM$vm
}

Viewing all articles
Browse latest Browse all 230663

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>