PowerShell script exchange
Post Reply
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Creating jobs using Add-VBRBackupJob in v6

Post by pizzim13 »

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.
tsightler
VP, Product Management
Posts: 6035
Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Creating jobs using Add-VBRBackupJob in v6

Post by tsightler »

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.
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Re: Creating jobs using Add-VBRBackupJob in v6

Post by pizzim13 »

Perfect. Just the info I needed. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests