AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() So I did a bit of digging around in the DPM powershell commandlet and came up with this little command. Our auditors were curious about what exactly our Microsoft Data Protection Manager server was backing up. Backing up and restoring ESXi configuration using the vSphere Command-Line Interface and vSphere PowerCLI (2042141).All rights reserved.Ĭonnecting to vCenter Server īacking Up Host Configuration: ĭata : D:\Powershell\vSphere\īacking Up Host Configuration: ĭata : D:\Powershell\vSphere\īacking Up Host Configuration: ĭata : D:\Powershell\vSphere\ If you need more help, visit the PowerCLI community: Get-PowerCLICommunityĬopyright (C) 1998-2012 VMware, Inc. Once you've connected, display all virtual machines: Get-VM To show searchable help for all PowerCLI commands: Get-PowerCLIHelp To find out what commands are available, type: Get-VICommand Log in to a vCenter Server or ESX host: Connect-VIServer $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")ĭ:\Powershell\vSphere> & '.\Backup All ESXi Configurations.ps1' Get-VMHostFirmware -VMHost $VMHost -BackupConfiguration -DestinationPath $localpath Write-Host "Backing Up Host Configuration: $VMHost" -foreground green # Get list of all ESXi hosts known by vCenter Write-Host "Connecting to vCenter Server $vCenter" -foreground greenĬonnect-viserver $vCenter -WarningAction 0 ![]() # Specify vCenter Server, vCenter Server prompts for username and vCenter Server user password "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1" Be sure to update the $vCenter variable with your vCenter address. ![]() It will prompt you for credentials to login on the vCenter server at the beginning of execution. This script requires that VMware PowerCLI is installed on the workstation where it is executed. This will generate a file for each of your ESXi servers that can be restored using the Set-VMHostFirmware command in PowerCLI. This script simply gets each ESXi host from the vCenter server and then runs the backup configuration command against it. There is an alternative if you know a little Powershell and install VMware’s PowerCLI you can use Powershell style command to interact with VMware vCenter. VMware uses Host Profiles however this feature is all the way at the top of the licensing with Enterprise Plus. Rebuilding a ESXi host can take a long time especially if you have a complicated environment. ![]()
0 Comments
Read More
Leave a Reply. |