PowerShell script exchange
Post Reply
sandsturm
Veteran
Posts: 279
Liked: 23 times
Joined: Mar 23, 2015 8:30 am
Contact:

Create Backupjob based on vSphere tags

Post by sandsturm »

Hi

I want to create new backupjobs via powershell, but I couldn't find a way to create a new backupjob with a vSphere tag as the object to backup. Is there a way to do that? I want to use something like Add-VBRViBackupJob -Name "CRM Backup" -Entity <vSphere_tag>

thx
sandsturm
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Create Backupjob based on vSphere tags

Post by jhoughes »

You need to get the vCenter server, backup repository, and the VMware tag entity first.

Then you can create the job:

Code: Select all

$VeeamRepository = Get-VBRBackupRepository -Name 'ReFS-PerVM'
$vCenterServer = Get-VBRServer -Name 'ausvcenter.lab.fullstackgeek.net'

$VMwareTag = 'vSphereTag'
$VeeamTag = Find-VBRViEntity -Name $VMwareTag -Tags -Server $vCenterServer

$VeeamBackupJob = Add-VBRViBackupJob -Name 'Demo Backup Job' -Description 'Demo backup job created via script' -BackupRepository $VeeamRepository -Entity $VeeamTag
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
sandsturm
Veteran
Posts: 279
Liked: 23 times
Joined: Mar 23, 2015 8:30 am
Contact:

Re: Create Backupjob based on vSphere tags

Post by sandsturm »

Great, that did the trick

thx
sandsturm
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests