Creating jobs using Add-VBRBackupJob in v6

PowerShell script exchange

Creating jobs using Add-VBRBackupJob in v6

Veeam Logoby pizzim13 » Fri Mar 16, 2012 9:23 pm

It doesn't look like I can set a backup repo when creating a job using Add-VBRBackupJob. You can only set a folder path, which creates a new backup repo. I am assuming it can be changed after the job is created by using Set-VBRJobOptions. The help for Add-VBRBackupJob reads that the -folder parameter is not required but it seems that it is required.

PS H:\> Add-VBRBackupJob -name "No_stuff" -Server (Get-VBRServer -name "this server") -Objects VMware-RCLI-3.5-U2
Add-VBRBackupJob : Value cannot be null.
Parameter name: path
At line:1 char:17
+ Add-VBRBackupJob <<<< -name "No_stuff" -Server (Get-VBRServer -name "this server") -Objects VMware-RCLI-3.5-U2
+ CategoryInfo : InvalidOperation: (Veeam.Backup.Po...AddVBRBackupJob:AddVBRBackupJob) [Add-VBRBackupJob]
, ArgumentNullException
+ FullyQualifiedErrorId : Backup,Veeam.Backup.PowerShell.Command.AddVBRBackupJob


An issue I see is that I need to set some type of junk path when creating the job which in turn creates a junk repo. Is there a way to set backup repo when creating the job? I just started playing around with v6. I may just be confused on how to properly use a backup repo.

---

In the future I would like to see an Entities property (like Add-VBRJobObject) for Add-VBRBackupJob. Since Veeam can backup VMs from multiple vCenter servers the possibility arises that you could have multiple VMs with the same name. If I am creating a job via powershell and adding a VM via its name (string) and that VM's name is duplicated in more than one environment Veeam will put all VMs with that name into that newly created job.
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Creating jobs using Add-VBRBackupJob in v6

Veeam Logoby tsightler » Sat Mar 17, 2012 1:54 am

I think all of this is already possible, but I'm still ramping up on V6 PowerShell.

The Add-VBRBackupJob cmdlet is really deprecated in V6, you should be using the hypervisor specific versions of these command, Add-VBRViBackupJob (vSphere) or Add-VBRHvBackupJob (Hyper-V). These cmdlets require a "Repository" object, which can be populated by the Get-VBRBackupRepository cmdlet. Also, these new cmdlets support adding VMs by Entity, so that addresses your other concern as well.
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Creating jobs using Add-VBRBackupJob in v6

Veeam Logoby pizzim13 » Sat Mar 17, 2012 11:12 am

Perfect. Just the info I needed. Thanks.
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests