Skip to content

Instantly share code, notes, and snippets.

@ddmunhoz
Created February 2, 2018 20:46
Show Gist options
  • Save ddmunhoz/7c38e69872819c767182acdb0eda4bee to your computer and use it in GitHub Desktop.
Save ddmunhoz/7c38e69872819c767182acdb0eda4bee to your computer and use it in GitHub Desktop.
Change ESXI host root account password
#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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment