Skip to content

Instantly share code, notes, and snippets.

@hospitableit hospitableit/ESXiRestore.ps1 Secret
Created Feb 23, 2019

Embed
What would you like to do?
# 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
You can’t perform that action at this time.