This little script kinda goes with the Backup script in my previous post. The specific use case is that of an ESXi host that has had to be rebuilt from scratch due to some sort of hardware failure. Install and patch it to the same level as the backup file you have for it (This is where the Manifest file comes in handy!). Do NOT join it to the vCentre server, assuming it is still defined in vCenter, this restore process will automagically reconnect it to vCenter.
To run this script you will need to install VMWare PowerCLI, have access to the relevant backup files and alter the variables at the top of the script to suit your environment.
Thank-you for the article and script. I have a follow up question. Is there a way to restore the configuration to a ESXi (6.5) host that is at a slightly different patch level? I have to do a fresh install of a host, and I’d love to import the configuration backup, but I’ve heard this doesn’t work unless the patch levels match. Is there a way to force it?