Skip to content

Instantly share code, notes, and snippets.

View ddmunhoz's full-sized avatar

Diego Munhoz ddmunhoz

View GitHub Profile
@ddmunhoz
ddmunhoz / ps1
Created February 2, 2018 20:46
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}