Home > PowerCLI, VMware > ESXi 5.0 / ESXi 5.1 Host Backup & Restore GUI Utility (PowerCLI based)

ESXi 5.0 / ESXi 5.1 Host Backup & Restore GUI Utility (PowerCLI based)

February 5th, 2012 Leave a comment Go to comments


This is a little bit of  a fun project I have been working on in bits of spare time I find. It is all written in PowerCLI 5.0 / 5.1 / PowerShell and the GUI was laid out using Primal Forms Community Edition.


Updates (17-02-2013) – version 1.3:

  • Hosts are retrieved using a new method (for both backup and restore options)

Updates (29-12-2012) – version 1.2:

  • Added ESX/ESXi host validation into utility – will now test that the host is valid and either connected or in maintenance mode before attempting backup or restore (See the script’s new “Check-VMHost” function for those interested)
  • Minor UI improvements

Updates (29-10-2012) – version 1.1:

  • This utility has been tested on ESXi 5.1 Hosts and confirmed to be able to successfully create a backup archive file of these.
  • Be sure your DNS is working correctly on the system you run the Backup utility on – it relies on DNS to find your ESXi hosts as they are named in the dropdown when you select the host to backup. (See comments for troubleshooting)
  • Restore to new hardware (force restore) option added
  • Fixed labels and connection box label description


What it is essentially, is a GUI that allows you to Backup ESXi 5.0 or ESXi 5.1 hosts to a destination of your choice on a local drive. It also allows you to restore ESXi Host configuration bundle backups taken, to other Hosts. I had other plans to integrate cloud storage options in (Amazon S3) as a backup target, but I thought that this doesn’t really offer anything valuable and I would just keep it relatively simple for now – therefore I have disabled this functionality. The PowerCLI script is fairly long – and I know there are plenty improvements I could make to better it and shorten the code, but for now it does the job. I have added various catches for exceptions / errors so you should get visual feedback if you have entered an invalid path, or username for example.


Anyway, hopefully this proves useful to some! As always, take care using the backup / restore functionality of this utility. The restore functionality works by first putting the ESXi host into Maintenance mode (if it isn’t already in this mode) and then applying a backup bundle to the host (Restore). The Host will reboot immediately following this. The Backup and Restore is implemented using Get-VMHostFirmware and Set-VMHostFirmware cmdlets so you can read the help descriptions for an idea on how exactly these work. The Host Backup Bundles are stored in a path of your choice and when restoring from a path the cmdlet works by looking for a bundle filename that matches the name of your ESXi host selected to restore to. Note that the file browser module I have implemented here (used to select paths) is a modification of the work done by Ravikanth Chaganti on his PowerShell Help Browser GUI. I simply adapted his code to list the contents of local drives in a tree view instead of PowerShell Help cmdlets. The only limitation here is that I have not implemented code to browse further than one level into the root of each drive. If you can provide this modification yourself, please feel free to contribute in the comments! I have just not spent the extra time to do this myself yet.


Here are a couple of quick screenshots of the Utility / GUI:



ESXi 5.0 Host Backup & Restore GUI Utility & Path Browser


Current version (1.3):

(Version 1.3) Download ESXi 5 Host Backup & Restore GUI Utility (12854)


Previous versions:

(Version 1.2) Download ESXi 5 Host Backup & Restore GUI Utility (4499)

(Version 1.1) Download ESXi 5 Host Backup & Restore GUI Utility (1982)

(Version 1.0) Download ESXi 5 Host Backup & Restore GUI Utility (3489)




  1. Erick
    October 31st, 2012 at 22:17 | #1

    Hi Sean,

    Thank you though for this great tool you put together, it works fantastically great on ESXi5.1 hosts.

    appreciated your time.


  2. Raphael
    November 22nd, 2012 at 12:31 | #2

    Hey Sean,

    first of all.. BIG THANKS! the tool that you have created is really great and such an awesome thing!

    but my question –> what about ESXi 3.5/4.0/4.1 – is there a chance to backup these one too? :/

    thx – best regards

  3. November 22nd, 2012 at 14:38 | #3

    Hi Raphael,

    Thanks for your feedback – glad it has been useful. Regarding ESXi – earlier versions, I have tested this tool on 4.1 and above. 3.5 – no testing yet 🙂 I seem to recall there being a ESX Host Configuration Backup tool around the time that vSphere originally got released that could be used to backup host configurations. I think it is discontinued now as I can’t seem to find it.


  4. Richard
    November 24th, 2012 at 20:33 | #4

    Hello Sean!

    I am having the same problem that Steve Young has but I am not using vCenter Server and attempting to backup a 5.1 host. I have tried everything and still get the “caught a system exception” error. Using the PowerCLI 5.1 Release 1 and the ESXi host is Build 838463. Your script worked beautifully when I was on 5.0.

    Any thoughts?


  5. November 25th, 2012 at 01:01 | #5

    Hey Richard

    I’ll re-test with a single ESXi 5.1 host myself and see if I can replicate your issue. I assume you checked the DNS by pinging the actual FQDN of the host as it appears in the list of hosts in the utility? Did that resolve to an IP address?


  6. Flavio
    November 26th, 2012 at 18:23 | #6

    Hi, I can take backup an 4.1 and restore ESXi 5.1?

  7. JohnA
    November 30th, 2012 at 01:36 | #7

    Excuse my ignorence here please. So where is the “GUI” All that is contained in the Zip is a Powershell file and no GUI. How do I open it?

  8. Dean
    November 30th, 2012 at 02:18 | #8

    I’m hoping this utility will do what I’m wanting and I am trying to confirm. We have some ESXi 5.0 hosts that we want to upgrade to the latest 5.1. I am told that the 5.1 has to be a fresh install. What I want to do is be able to backup the host configuration for things like all the networking, storage adapters, connections to our SAN and that sort of thing. I don’t need to backup anything from the host other than the config. What I want to do is backup the config, blow the host away, do a clean install of 5.1, then restore the config so we don’t have to do it all manually. Will this utility do that? Thanks.

  9. JohnA
    November 30th, 2012 at 09:32 | #9

    Ignore my initial post. I spotted a mote in an earier post saying to

    ……….the utility, right-click the zip file, properties, select “Unblock”, then extract it. From within your PowerCLI prompt, run the utility by navigating to the folder you extracted it to, and typing .\NameofScript.ps1 and pressing Enter.

    I neglected to do the “Unblock”part……….. It works now that I did that. Thanks for that 🙂

  10. November 30th, 2012 at 10:14 | #10

    Glad you got it going 🙂 Ideally, I would like to compile this script into an executable. However that requires a paid-for version of PowerGUI (by Quest) and I don’t have the spare funds floating around to buy the professional version (Which supports compiling into executable).


  11. November 30th, 2012 at 10:18 | #11


    Yes it should do the trick provided you keep the hardware the same. I would however advise that you test in a test environment first – for example create a test 5.0 virtual ESXi server and another identical 5.1, then use the utility to backup/restore between them. Also, make sure you have a backup plan if you then plan to do this in production and things go wrong with the utility. I myself have not tested this on physical hardware before – only in my own lab on virtual ESXi hosts. So if you do have Enterprise plus licensing for example, you could fall back to host profiles, or if not, just make sure you have a planned re-build process if you need to re-create configuration from scratch in the worst case scenario.

    I don’t like putting people off using the utility I spent a lot of time creating, but just want to make sure people test in pre-production before using in production and cover all their bases!


  12. November 30th, 2012 at 10:18 | #12

    Hi Flavio,

    See my reply to Dean in the comments – same theory applies here – test in pre-production first!


  13. Marzo
    December 10th, 2012 at 14:33 | #13

    Hi Sean , I have this error when I clic on backup buttom (my c:\tmp)

    Exception caught Get-VMHostFirmware
    Value Cannot be found for the mandatory parameter VMHost

    I have Esx 5.1 (free) and the last powerCli too.
    What am I doing wrong?

  14. Marzo
    December 10th, 2012 at 15:16 | #14

    Marzo :
    Hi Sean , I have this error when I clic on backup buttom (my c:\tmp)
    Exception caught Get-VMHostFirmware
    Value Cannot be found for the mandatory parameter VMHost
    I have Esx 5.1 (free) and the last powerCli too.
    What am I doing wrong?

    More Info, maybe de FQND is the problem.

    Look this command from cmd PowerCli. I have registered in DNS my host and resolve right.

    PowerCLI C:\> Get-VMHostFirmware -VMHost esx01.tse.local -DestinationPath c:\tem
    Get-VMHostFirmware : 10/12/2012 10:00:51 Get-VMHostFirmware Could not
    find VMHost with name ‘esx01.tse.local’.
    En línea: 1 Carácter: 19
    + Get-VMHostFirmware <<<< -VMHost esx01.tse.local -DestinationPath c:\tmp
    + CategoryInfo : ObjectNotFound: (esx01.tse.local:String) [Get-VM
    HostFirmware], VimException
    + FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_ObjectNo

    Get-VMHostFirmware : 10/12/2012 10:00:51 Get-VMHostFirmware Value can
    not be found for the mandatory parameter VMHost
    En línea: 1 Carácter: 19
    + Get-VMHostFirmware <<< nslookup esx01
    Servidor: srv-tchdc01.tse.local

    Nombre: esx01.TSE.local

    PowerCLI C:\> nslookup esx01.tse.local
    Servidor: srv-tchdc01.tse.local

    Nombre: esx01.tse.local

    But, when I runs the cmd without domain name (only host name) this work fine.

    PowerCLI C:\> Get-VMHostFirmware -VMHost esx01 -DestinationPath c:\tmp

    Host Data
    —- —-
    esx01 c:\tmp\configBundle-esx01.tgz

  15. December 10th, 2012 at 15:18 | #15

    Hi Marzo,

    Looks like you have solved it – indeed the DNS is an issue and that message seems to be indicative of a the PowerCLI cmdlet not being able to resolve the host’s name.


  16. Marzo
    December 10th, 2012 at 16:46 | #16

    Not 100%, but I have a Question

    From the cmd (or powerCli) I can resolve the full (FQND) or shot name (DNS) with Nslookup without problem, but the Script can’t do that , Why?

  17. December 11th, 2012 at 09:50 | #17


    That is an odd one – how about ping? Does that not resolve an IP to the FQDN? Are you calling the script from the same PowerCLI prompt, i.e. ./scripname.ps1 ?

  18. Marzo
    December 12th, 2012 at 12:35 | #18

    Yes, I am calling from PowerCli cmd line.
    Remember that Ping cant resolve , this dont use DNS service, it’s 1 layer more down (OSI model)

  19. December 14th, 2012 at 16:43 | #19

    Ah thanks for clarifying that Marzo. Not too sure why else it would be doing that… Do let me know if you ever figure it out!

  20. vandammages
    December 29th, 2012 at 02:21 | #20

    same issue here I can use .

    PowerCLI C:\> Get-VMHostFirmware -VMHost IP address -DestinationPath c:\temp

    but not PowerCLI C:\> Get-VMHostFirmware -VMHost FQDN -DestinationPath c:\tem

    I can ping from Power CLI to FQDN and use nslookup no problem??
    it resolves to correct IP.??

  21. December 29th, 2012 at 15:41 | #21

    What happens if you do a “Get-VMHost “hostname”” in PowerCLI for this specific host? Does it return the host and info you would expect? For hostname, type the same name of the host you see in the “Hosts to backup” drop down list you see in the GUI tool.

  22. Carl
    December 31st, 2012 at 23:31 | #22


    I’m new to PowerCLI, and I tried following the steps outlined by BatMac on 8/27/2012 at 15:50 (#28) and keep getting an Exception error: “Exception caught: The argument is null or empty. Supply an argument that is not null or empty and then try the command again.”

    I have connected to the vCenter 5.0 server and a stand-alone ESXi 5.0 host by both IP address and DNS name and can perform the get-vmhost “name” and get-vm commands successfully.

    Is there a step or process I’m leaving out? Your help would be greatly appreciated.

  23. January 2nd, 2013 at 01:27 | #23

    Hi Carl,

    Any other info along with that exception? It should all be working as you have verified everything else. Are you using the 1.2 version?


  24. Carl
    January 3rd, 2013 at 18:29 | #24


    Yes, I’m using the 1.2 version. Unfortunately I don’t get any other messages.

    I open ‘VMware PowerLCI 5.1 Release 1′ on my Windows 7 64-bit computer, navigate to the directory where I have the software downloaded, and enter /.\ESXi5-Backup-Restore-Utility-1.2.ps1’. The system responds with a ‘vCenter IP or DNS Name’ window. I enter either the IP address or DNS name of either a ESXi 5.0 host (ex. or GRYMETVM01) and hit enter. I can do the same thing with a vCenter as well. Is there something I could do to help provide you with additional information? Is there a way to create a log file I could send you?

    Thanks as always.

  25. Carl
    January 3rd, 2013 at 18:37 | #25

    That’s ‘.\’ not ‘/.\’


  26. Jeroen
    January 4th, 2013 at 13:55 | #26


    I am having the same problem as Carl. Same versions also. Tool and cli

  27. January 4th, 2013 at 15:24 | #27

    Hi Carl,

    Thanks for additional info. That is the exact same version of PowerCLI and OS that I am using. No matter what I can’t seem to replicate this issue.

    There is a PowerCLI window that opens and displays a bit of logging info in the background when you use the GUI, can you try again, and then send me the output from that window? (Right-click -> Mark -> drag over the text, then press Enter to copy it to clipboard).

    If you see “$HostToBackup seems to be a valid host…” in green writing as you click the “Backup” button then all should be good. If you don’t see this and are getting an exception then it means PowerCLI is having trouble running the “Get-VMHostFirmware” cmdlet against your host. Let me know if you see this green text or not when clicking backup.

    If you don’t, then could you try run the following command (open a new instance of PowerCLI, and type this:)

    Get-VMHostFirmware -VMHost yourexamplehost.domain.local -BackupConfiguration -DestinationPath C:\temp -ErrorAction:SilentlyContinue

    Of course make sure that C:\temp exists and that you have write access. Also make sure you have initially connected to your VC with Connect-VIServer VCNAME too.

    Does running that Get-VMHostFirmware example above give a similiar error or does it work?

    Other things to check / make sure of:

    1. Make sure you have write access to folder you are targeting for the backup file.
    2. Make sure you have Admin role for vCenter or a role that allows you to backup host configuration (admin of course means you can do anything)
    3. Make sure you have right-clicked the downloaded file and selected properties, then Unblocked it (if the unblock button appears on the properties window).


  28. January 4th, 2013 at 15:25 | #28

    Hi Jeroen,

    Could you take a look at the reply I just sent to Carl – try out that troubleshooting and let me know what you get.


  29. Carl
    January 8th, 2013 at 22:09 | #29


    Here is the output from the command line instructions you provided me. I tried it using the FQDN and just the server name since I am in the same domain. You can see that I was able to successfully attach and back up the config when I used just the server name. I did unblock the file as well and still can’t successfully execute the GUI. Strange…


    PowerCLI C:\emc> connect-viserver grymetvm01

    Name Port User
    —- —- —-
    grymetvm01 443 root

    PowerCLI C:\emc> Get-VMHostFirmware -VMHost grymetvm01.internal.graycompanyinc.c
    om -BackupConfiguration -DestinationPath c:\EMC -ErrorAction:SilentlyContinue
    Get-VMHostFirmware : 1/8/2013 3:05:20 PM Get-VMHostFirmware Value
    cannot be found for the mandatory parameter VMHost
    At line:1 char:1
    + Get-VMHostFirmware -VMHost grymetvm01.internal.graycompanyinc.com
    -BackupConfigu …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-VMHostFirmware], VimExcep
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomatio

    PowerCLI C:\emc> Get-VMHostFirmware -VMHost grymetvm01 -BackupConfiguration -Des
    tinationPath c:\EMC -ErrorAction:SilentlyContinue

    Host Data
    —- —-
    grymetvm01 c:\EMC\configBundle-grymetvm01.tgz

    PowerCLI C:\emc>

  30. megamorf
    January 15th, 2013 at 16:08 | #30

    At those having problems:

    Please make sure to enclose the server names in single or double quotes as the parsing engine of powershell could read the dots of the FQDN as special characters.

  31. Ralf
    February 13th, 2013 at 08:53 | #31

    Hey Sean,

    Great tool!

    I have this function laying around to browse all drives and folders on your computer. I picked it up in another form from the powershell.com forums and modified it for my own needs at the time.

    function Get-Folder()

    $FolderBrowserDialog = New-Object System.Windows.Forms.FolderBrowserDialog
    $FolderBrowserDialog.Description = “Backup destination”
    $FolderBrowserDialog.RootFolder = “MyComputer”
    $FolderBrowserDialog.ShowDialog() | Out-Null


    This should do the trick 🙂


  32. February 13th, 2013 at 09:46 | #32

    Hey Ralf,

    This looks very useful, thanks for dropping me the note!


  33. Ralf
    February 13th, 2013 at 09:55 | #33

    I was trying to add this function to your script myself when I realized you need to browse to the actual file when you want to restore. The Get-Folder function can’t do that, so you’ll need something like this as well I think:

    Function Get-FileName($initialDirectory)
    [System.Reflection.Assembly]::LoadWithPartialName(“System.windows.forms”) |

    $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
    $OpenFileDialog.initialDirectory = $initialDirectory
    $OpenFileDialog.filter = “All files (*.*)| *.*”
    $OpenFileDialog.ShowHelp = $true
    $OpenFileDialog.ShowDialog() | Out-Null

    Get-FileName -initialDirectory “C:\”

    I found this code originally on the Hey, Scripting Guy! blog.


  34. Milan
    February 26th, 2013 at 14:34 | #34

    Hi, please, I have small quetion. We cannot use DNS of ESXi Hosts in our network and I would like to use this your tool for backup of VMWare settings. Is possible to use for backup or recovery only IP?

    My current error:
    Exception caught: Get-VMHost VMHost with name ‘xxx’ was not found using the specified filter(s).

    Thank you very much for help.

  35. February 26th, 2013 at 14:39 | #35


    I have made a newer version recently (1.3) which should fix this issue – it was for somebody else, and I haven’t had a chance to publish it yet. I’ll post it up later – give it a go and let me know if it works 🙂


  36. Paul Sheard
    February 26th, 2013 at 18:11 | #36


    Hi Sean,

    where can I find the v1.3?

  37. February 26th, 2013 at 18:39 | #37

    Hi Paul,

    Just posted it up now – give it a try. Hopefully it resolves the exception issue (if you were getting it). http://vrtz.me/ff


  38. February 26th, 2013 at 18:40 | #38

    Hi Milan,

    Just posted it up now (version 1.3) – give it a try. Hopefully it resolves the exception issue (if you were getting it). http://vrtz.me/ff


  39. Milan
    February 28th, 2013 at 10:04 | #39

    Hi Sean, thank you for new version. Backup with only HOST IP works well. Recovery I will testing little bit later. Thank you very much.

  40. Pak
    March 5th, 2013 at 15:47 | #40

    Hi Sean,

    Thanks for creating this. It seems to back up nicely, though I haven’t tested a restore (not having a test machine to play with at the moment).

    However, there’s a bug (design decision?) in the file browser: I only get a choice of C: drive and its top-level folders. I can’t browse to sub-folders or network drives, though I can type them in and it works with them.


  41. Pak
    March 5th, 2013 at 16:15 | #41

    Ah, follow-up on that; I hadn’t fully read your post! I’ll see if I can take a look at the drill-down bit (I’ve already implemented a change for the Network Drives bit) at some point.

    For the curious, the change to display Network Drives is at line 131, changing it to read:

    Line 131
    $LocalDrives = Get-WMIObject -ComputerName localhost Win32_LogicalDisk | Where-Object { (($_.DriveType -eq 3) -or ($_.DriveType -eq 4)) -and ($_.FreeSpace -gt 30000) } | Select DriveType, VolumeName, Name #Get all relevant drive types and list them

    I’ve added a FreeSpace check to make sure that there is enough space to save your configuration bundle, and to omit drives that aren’t actually connected properly at the moment.

  42. March 5th, 2013 at 16:49 | #42


    Hi Pak,

    Thanks for the comments! You could call it a design decision! Haha, yes, the file browser code is actually based off someone else’s code, and I didn’t spend much time modifying it to support children nodes.

    Excellent work adding the Network Drives and the disk space check – great little addition there I must say. I’ll try to remember to include that in the next update and attribute it to you 🙂

    If you do manage to figure out the sub-folder work, do let me know – would be interested in seeing that, although I suspect it’ll be a bit of work to add that in.


  43. Malte
    March 7th, 2013 at 11:55 | #43

    Hi Sean,

    thank you for creating this tool! It is exactly what I was looking for.

    However, I get an error when I try to connect to any of my ESXi-Hosts:

    After I type in the IP-Adress of the Host (or type in ANYTHING) I get following error:

    caught a System exception

    Exception caught: The Argument is NULL or empty. Provide an Argument that is not NULL or empty and execute the command again.

    (Translated the error message from german so it might not be 100% correct)

    Am I doing something wrong? I’m rather new to PowerShell and PowerCLI so that might be the case. 😉

    My Environment:
    YourScript v1.3
    Windows 8
    PowerShell 2.0
    PowerCLI 5.1.0 R2


  44. PhS
    April 10th, 2013 at 15:45 | #44

    Thank you very much for these script. Am I the only one that doesn’t get it to run ?
    I get the prompt for entering the IP or Name, fill it with the ip of my vcenter. And I get :
    “Exception caught: The Argument is null or empty. Supply an argument that is not null or empty and then try the command again. . ”

  45. Tony
    April 12th, 2013 at 21:39 | #45

    I am getting an error when executing this in powershell under Windows 8 64-bit. Can someone assist with the problem.

Comment pages
  1. December 29th, 2012 at 16:23 | #1
  2. December 29th, 2012 at 21:59 | #2
  3. December 30th, 2012 at 17:02 | #3
  4. February 28th, 2013 at 04:13 | #4
  5. March 2nd, 2013 at 21:33 | #5

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.