PowerShell script exchange
Post Reply
sidavid
Enthusiast
Posts: 63
Liked: 1 time
Joined: Jan 01, 2006 1:01 am
Contact:

Add-VBRBackupJob From Veeam 5 to 6

Post by sidavid »

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)
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Add-VBRBackupJob From Veeam 5 to 6

Post by ThomasMc »

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

Re: Add-VBRBackupJob From Veeam 5 to 6

Post by ThomasMc »

sidavid
Enthusiast
Posts: 63
Liked: 1 time
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Add-VBRBackupJob From Veeam 5 to 6

Post by sidavid »

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: 63
Liked: 1 time
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Add-VBRBackupJob From Veeam 5 to 6

Post by sidavid »

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)
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Add-VBRBackupJob From Veeam 5 to 6

Post by Andreas Neufert »

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
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests