Powershell to add a copy job from a backup job

PowerShell script exchange

Powershell to add a copy job from a backup job

Veeam Logoby jed-hyper » Thu Nov 24, 2016 2:33 am

Within the GUI i can add a backup job as the virtual machine object for the backup copy job setup. When i do this and run the backup copy job it includes any new virtual machines that i have added to main main backup job
How can i do this in powershell?
Using this command I can add a backup copy job with all my VMs but if i add any VMs in the future i will have to manually add them to this backup copy job
Hope that makes sense...
Code: Select all
Add-VBRHvBackupCopyJob -DirectOperation  -Name $Job_Name_BackupJobForever -Repository 'Repository-BackupJob-Forever' -Entity ( Find-VBRHvEntity | Where-Object { $_.Type -eq 'Vm' } )
jed-hyper
Enthusiast
 
Posts: 33
Liked: 4 times
Joined: Wed Feb 26, 2014 4:42 am
Full Name: Jed Parkes

Re: Powershell to add a copy job from a backup job

Veeam Logoby tsightler » Thu Nov 24, 2016 4:39 am

Please see the -BackupJob parameter which I believe addresses what your are looking to do:

https://helpcenter.veeam.com/docs/backu ... tml?ver=95
tsightler
Veeam Software
 
Posts: 4843
Liked: 1787 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Powershell to add a copy job from a backup job

Veeam Logoby jed-hyper » Thu Nov 24, 2016 5:04 am 1 person likes this post

I missed that one some how, thanks
this work for me
Code: Select all
Add-VBRHvBackupCopyJob -DirectOperation -Name $Job_Name_BackupJobForever -Repository 'Repository-BackupJob-Forever' -BackupJob $Job_Name_BackupJobMain
jed-hyper
Enthusiast
 
Posts: 33
Liked: 4 times
Joined: Wed Feb 26, 2014 4:42 am
Full Name: Jed Parkes


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests