PowerShell script exchange
Post Reply
davguan
Novice
Posts: 3
Liked: 1 time
Joined: Apr 01, 2013 5:48 pm
Full Name: DG
Contact:

Assistance with Add-VBRViBackupJob

Post by davguan »

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
Vitaliy S.
VP, Product Management
Posts: 27377
Liked: 2802 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Assistance with Add-VBRViBackupJob

Post by Vitaliy S. »

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!
davguan
Novice
Posts: 3
Liked: 1 time
Joined: Apr 01, 2013 5:48 pm
Full Name: DG
Contact:

Re: Assistance with Add-VBRViBackupJob

Post by davguan »

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: Apr 01, 2013 5:48 pm
Full Name: DG
Contact:

Re: Assistance with Add-VBRViBackupJob

Post by davguan » 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"})
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Assistance with Add-VBRViBackupJob

Post by veremin »

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

Who is online

Users browsing this forum: No registered users and 10 guests