This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create a Host List | |
$vmhosts = Get-VMhost | |
$Get credential required to log in as root on the ESXI Hosts | |
$oldCredential = Get-Credential | |
$vmhosts | foreach {Connect-Viserver $_.Name -credential $oldCredential -warningaction silentlycontinue ; Set-VMHostAccount -UserAccount root -password "TYPE_YOUR_PASSWORD_HERE" ; Disconnect-viserver -server $_.Name -Confirm:$false} |