The most important thing to remember
Configuration : Job -> Job Runs : BackupSession -> Result : Backup
Job
Get Job
$backupjobname = "Backup Job 1"
$job = get-vbrjob -name $backupjobname
Job sections:
- VBRJobObject : Section Virtual Machines
- VBRJobProxy : Section Storage > Backup Proxy
- VBRJobAdvancedBackupOptions : Section Storage > Button Advanced > Tab Backup
- VBRJobAdvancedStorageOptions : Section Storage > Button Advanced > Tab Storage
- VBRJobAdvancedNotificationOptions : Section Storage > Button Advanced > Tab Notifications
- VBRJobAdvancedViOptions : Section Storage > Button Advanced > Tab vSphere
- VBRJobAdvancedHvOptions : Section Storage > Button Advanced > Tab Hyper-V
- VBRJobAdvancedOptions : Section Storage > Button Advanced > Tab Scripts
- VBRJobObjectVssOptions : Section Guest Processing > Button Applications > Edit of individual VM/Container
- VBRJobVssOptions : Section Guest Processing
- VBRJobGuestFSIndexing : Section Guest Processing > Checkbox Indexing
- VBRJobVSSIntegration : Section Guest Processing > Checkbox AAIP
- VBRJobSchedule : Section Schedule (inline edit with set-)
- VBRJobScheduleOptions : Section Schedule
- VBRJobOptions : Special object since it contains the actual configuration of almost everything
The generic set method
$joboptions = Get-VBRJobOptions -Job $backupjob
$joboptions.BackupStorageOptions.RetainCycles = 30
$updatedjob = Set-VBRJobOptions -Job $backupjob -Options $joboptions
The specific option
The Pairs
- Get-VBRJobOptions / Set-VBRJobOptions
- Get-VBRJobVSSOptions / Set-VBRJobVssOptions
- Get-VBRJobObjectVssOptions / Set-VBRJobObjectVssOptions
- Get-VBRJobScheduleOptions / Set-VBRJobScheduleOptions
Inline edits
- Set-VBRJobAdvancedBackupOptions
- Set-VBRJobAdvancedHvOptions
- Set-VBRJobAdvancedNotificationOptions
- Set-VBRJobAdvancedOptions
- Set-VBRJobAdvancedStorageOptions
- Set-VBRJobAdvancedViOptions
- Set-VBRJobSchedule
For example
Set-VBRJobSchedule -Job $backupjob -Monthly -NumberInMonth 2 -Days Monday
Adding VMs to a job
$vm = Find-VBRViEntity -HostsAndClusters -Name "vm1"
Add-VBRViJobObject -Job $backupjob -Entities $vm
Removing
$jobobject = Get-VBRJobObject -Job $backupjob -Name "vm1"
Remove-VBRJobObject -Objects $jobobject
Some examples
Do something on every job
$Jobs = Get-VBRJob | where {$_.JobType -eq "Backup" -or $_.JobType -eq "Replica"}
foreach ($Job in $Jobs)
{
#Take action on a $Job here
}
change block size on every job
$Jobs = Get-VBRJob | where {$_.JobType -eq "Backup" -or $_.JobType -eq "Replica"}
foreach ($Job in $Jobs)
{
$Options = Get-VBRJobOptions -Job $Job
$Options.BackupStorageOptions.StgBlockSize = [Veeam.Backup.Common.EKbBlockSize]::KbBlockSize1024
$null = Set-VBRJobOptions -Job $job -Options $options
}