Skip to content

Instantly share code, notes, and snippets.

@hospitableit
Created February 23, 2019 04:54
Show Gist options
  • Save hospitableit/9e700fba8eed8bc1aae0e833a333f475 to your computer and use it in GitHub Desktop.
Save hospitableit/9e700fba8eed8bc1aae0e833a333f475 to your computer and use it in GitHub Desktop.
# Change these variables to suit your environment
$ESXiHost = "esxihost.mynetwork.com"
$BackupFile = "d:\Backups\ESXi\configBundle-esx02.mynetwork.com.tgz"
$ESXiUserName = "ESXi Username"
$ESXiPassword = "ESXi Password"
#Connect to the ESXi host
Connect-VIServer -Server $ESXiHost
#Put the ESXi Host into Maintenance Mode
Set-VMHost -VMHost $ESXiHost -State 'Maintenance'
#Restore the configuration
Set-VMHostFirmware -VMHost $ESXiHost -Restore -SourcePath $BackupFile -HostUser $ESXiUserName -HostPassword $ESXiPassword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment