I'm trying to set up a script to run the backups of my Virtual Machines only using WBADMIN, I've got as fas as being able to backup all the VMs using the new -HyperV switch, however I also want to backup the HyperV Host Component. Does anyone have any experience in doing this or can point me to some documentation (the Microsoft one neglects this new -HyperV switch)
This is my powershell script if your interested:
#Constant Variables
$Day = Get-Date
$Day = $Day.DayOfWeek
$Date = Get-Date -format hhmmddMMyyyy
$Server = hostname
#Set Paths
$BackupPath = "\\backup\Backups\" + $Server + "\" +$Day
$LogPath = "\\backup\Backups\" + $Server + "\Logs\" + $Date +".txt"
# SELECT Virtual Machines
$VMList = $null
$VMs = Get-VM | Select-Object VMId
for ($i = 0 ; $i -lt $VMs.length ; $i++) {
$VMList = $VMList + '"' + $VMs[$i].VMId + '"' +","
}
$VMList = $VMList.Substring(0,$VMList.Length - 1)
#Run Backup
WBADMIN START BACKUP -backupTarget:$BackupPath -hyperv:$VMList -Quiet