I needed to make 50+ backup jobs in a Veeam environment and decided to create a PowerShell script to automate this repetitive work. Please find below the script I made to set most of the options within a Veeam backup job. The scripts accepts to parameters: the backup location (e.g. d:\backups) and the backup job name.
# *****************************************************
# This script creates a basic backup job
# Usage : createbackup <backup job location> <backup job name>
# Author : Ted Steenvoorden
# Version: 1.0
# Date : 18-10-2011
# *****************************************************
$vbrserver = Get-VBRServer | Where {$_.Type -eq “Local”}
$vbrjobname = $args[1]
$vbrfolder = $args[0]
$vbrobjects = “server1″
Add-VBRBackupJob -Name $vbrjobname -Type VDDK -Server $vbrserver -Folder $vbrfolder -Objects $vbrobjects
# Set Job options
$job = Get-VBRJob | where {$_.name -eq $vbrjobname}
$options = Get-VBRJobOptions $job
$options.VDDKMode = “san”
$options.FailoverToNetworkMode = $false
$options.Algorithm = “Syntethic”
$options.RunManually = $false
Set-VBRJobOptions -job $job -options $options
# Set Job VSS options
$vssoptions = Get-VBRJobVSSOptions $job
$Credentials = New-Object -TypeName Veeam.Backup.Common.CCredentials -ArgumentList “username”,”password”,0,0
$vssoptions.Credentials = $Credentials
$vssoptions.Enabled = $true
Set-VBRJobVSSOptions -job $job -options $vssoptions
# Set Job scheduling options
$schedule = Get-VBRJobScheduleOptions $job
$schedule.OptionsDaily.Enabled = $true
$schedule.OptionsDaily.Kind = “SelectedDays”
$schedule.OptionsDaily.Time = “19:30:00″
$schedule.RetryTimes = “1″
Set-VBRJobScheduleOptions -Job $job -Options $schedule