Assistance with Add-VBRViBackupJob

PowerShell script exchange

Assistance with Add-VBRViBackupJob

Veeam Logoby davguan » Tue Feb 04, 2014 5:35 pm

Hi,

I'm trying to create simple job with the following in Veeam 7. For Entity, I would like to point the job to a folder and not a VM. Not exactly sure how to go about entering that. I tried searching, but found massive scripts. I'm just trying to setup something simple.

Add-VBRViBackupJob -Name "Test" -BackupRepository "Test Repo" -Entity


Dave
davguan
Novice
 
Posts: 3
Liked: 1 time
Joined: Mon Apr 01, 2013 5:48 pm
Full Name: DG

Re: Assistance with Add-VBRViBackupJob

Veeam Logoby Vitaliy S. » Tue Feb 04, 2014 9:06 pm

Hello Dave,

I believe you should be using something like this:
Code: Select all
Add-VBRViBackupJob -Name $JobName -BackupRepository $JobRepository -Entity (Find-VBRViEntity -VMsAndTemplates -Name $FolderName)

Thank you!
Vitaliy S.
Veeam Software
 
Posts: 19566
Liked: 1104 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Assistance with Add-VBRViBackupJob

Veeam Logoby davguan » Tue Feb 04, 2014 9:54 pm

Thanks.

Here is another dilemma I'm facing regarding the folder itself. Each job points to A or B subfolder. The A or B subfolders are not unique in name like "folder1". Under VBRViEntity, can I specify a "path"?

Folder1
A
B
Folder2
A
B
davguan
Novice
 
Posts: 3
Liked: 1 time
Joined: Mon Apr 01, 2013 5:48 pm
Full Name: DG

Re: Assistance with Add-VBRViBackupJob

Veeam Logoby davguan » Wed Feb 05, 2014 2:28 am 1 person likes this post

I think I found the solution to my own question. Hope this helps someone in the future.

Code: Select all
Add-VBRViBackupJob -Name "$Job" -BackupRepository "$Repo" -Entity (Find-VBRViEntity -Server $Server -VMsAndTemplates -Name "$A" | Where-Object {$_.Path -eq "server\Folder1\A"})
davguan
Novice
 
Posts: 3
Liked: 1 time
Joined: Mon Apr 01, 2013 5:48 pm
Full Name: DG

Re: Assistance with Add-VBRViBackupJob

Veeam Logoby v.Eremin » Wed Feb 05, 2014 9:02 am

Yes, you're completely right here. Even though, folders might have the same name, there should be another parameter, using which you can distinguish one folder from the other. It might be path or some other criteria. Typically, you can use Get-Member commandlet in order to see what parameters the given objects have and, then, see which one can be used for distinguishing purpose.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13290
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests