Add-VBRBackupJob From Veeam 5 to 6

PowerShell script exchange

Add-VBRBackupJob From Veeam 5 to 6

Veeam Logoby sidavid » Wed May 09, 2012 1:16 am

Hi,

I have updated Veeam backup from 5 to 6. In version 5, I have the following command to create a job. Now I want to know how to set a specific backup proxy and an specific backup repository.

Many thanks in advance

Add-VBRBackupJob -Name $vbrjobname -Type VDDK -Server $vbrserver -Folder $vbrfolder -FileName $vbrfile -Objects $vmname
$job = Get-VBRJob | ?{$_.name -eq $vbrjobname}
Add-VBRJobObject -Job ($job) -Server ($server1) -Objects ($vmname)
$vo = $job.GetOptions()
$vo.RetainCycles = 2
$vo.RetainDays = 1
$vo.CompressionLevel = 9
$vo.VMToolsQuiesce = $true
$vo.Algorithm = "Syntethic"
$job.SetOptions($vo)
sidavid
Enthusiast
 
Posts: 60
Liked: never
Joined: Sun Jan 01, 2006 1:01 am

Re: Add-VBRBackupJob From Veeam 5 to 6

Veeam Logoby ThomasMc » Wed May 09, 2012 9:22 am

A couple of posts down would have got you on the right track ;)
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Add-VBRBackupJob From Veeam 5 to 6

Veeam Logoby ThomasMc » Wed May 09, 2012 10:14 pm

ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Add-VBRBackupJob From Veeam 5 to 6

Veeam Logoby sidavid » Thu May 10, 2012 3:29 am

Hi,

Thanks I can add jobs now ;-) but I have issue to setup configuration Like type of Backup, EmailNotification, COmpression...
Code: Select all
get-folder "Support" | get-vm | foreach {
$v = $_.name
$vbrjobname = $v
$rep = Get-VBRBackupRepository | where {$_.name -eq "Backup Repository D"}
$enty = Find-VBRViEntity -Name $v
Add-VBRViBackupJob -Name $vbrjobname -BackupRepository $rep -Entity $enty

$job = Get-VBRJob | ?{$_.name -eq $vbrjobname}
$vo = $job.GetOptions()
$vo.EmailNotification = $true
$vo.EmailNotificationAddresses = ""
$vo.UseChangeTracking = $true
$vo.EnableChangeTracking = $true
$vo.RetainCycles = 2
$vo.RetainDays = 1
$vo.CompressionLevel = 9
$vo.VMToolsQuiesce = $true
$vo.Algorithm = "Syntethic"

$job.SetOptions($vo)

Can you help me, please?

Thanks
sidavid
Enthusiast
 
Posts: 60
Liked: never
Joined: Sun Jan 01, 2006 1:01 am

Re: Add-VBRBackupJob From Veeam 5 to 6

Veeam Logoby sidavid » Thu May 10, 2012 3:51 am

I understand how it works ;-)
Code: Select all
$job = Get-VBRJob | ?{$_.name -eq $vbrjobname}
$vo = $job.GetOptions()

$vo.NotificationOptions.EmailNotification = $true
$vo.BackupStorageOptions.EnableChangeTracking = $true
$vo.BackupStorageOptions.RetainCycles = 2
$vo.BackupStorageOptions.RetainDays = 1
$vo.BackupStorageOptions.CompressionLevel = 9
$vo.BackupTargetOptions.Algorithm = "Syntethic"
$vo.ViSourceOptions.VMToolsQuiesce = $true

$job.SetOptions($vo)
sidavid
Enthusiast
 
Posts: 60
Liked: never
Joined: Sun Jan 01, 2006 1:01 am

Re: Add-VBRBackupJob From Veeam 5 to 6

Veeam Logoby Andreas Neufert » Thu May 10, 2012 9:43 pm

Hi sidavid,

here you can find my example v6 script that doing exactly what you are looking for.
Add VM to Job/Create job and add VM

CU Andy
Andreas Neufert
Veeam Software
 
Posts: 2198
Liked: 357 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM


Return to PowerShell



Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 7 guests