PowerShell script exchange
Post Reply
k00laid
Veeam Vanguard
Posts: 222
Liked: 51 times
Joined: Jan 13, 2011 5:42 pm
Full Name: Jim Jones
Location: Hurricane, WV
Contact:

Recurse a tags based backup job to get a list of VMs in Job

Post by k00laid »

I'm trying to write a script that lists all the VMs to be backed up with in a job so I can restart services in a pre-backup script. Our backups are 100% tag driven at this point so when I do

Get-VBRJob -Name $jobname | Get-VBRJobObject | select name

All I get at this point is the name of my VMware tag and some old data that is not used any more. Is there a way to recurse that tag to get a listing of the VMs?
Jim Jones, Sr. Product Infrastructure Architect @iland / @1111systems, Veeam Vanguard
Rick.Vanover
Veeam Software
Posts: 708
Liked: 167 times
Joined: Nov 30, 2010 3:19 pm
Full Name: Rick Vanover
Location: Columbus, Ohio USA
Contact:

Re: Recurse a tags based backup job to get a list of VMs in Job

Post by Rick.Vanover »

Kudos Jim for being 100% tag-driven.

Curious if the tag result could be thru vSphere PowerCLI vs. the Veeam one cmdlet? (I'm no scripter, but I'm thinking which system "owns" the object - the tag)
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Recurse a tags based backup job to get a list of VMs in Job

Post by veremin »

Use Find-VBRViEntity along with -Tags parameter; should be something you're after. More information can be found here. Thanks!
k00laid
Veeam Vanguard
Posts: 222
Liked: 51 times
Joined: Jan 13, 2011 5:42 pm
Full Name: Jim Jones
Location: Hurricane, WV
Contact:

Re: Recurse a tags based backup job to get a list of VMs in Job

Post by k00laid »

@Rick The easiest version of this that I've been able to do is just that, query vSphere for it instead of Veeam. It actually looks like the Find-VBRViEntity -Tags option is trying to do just that, direct asking my VCSA for information based on the tag. What this doesn't do is give you a full listing of the VMs actively processed by the job, you have to know the tag name first.
Jim Jones, Sr. Product Infrastructure Architect @iland / @1111systems, Veeam Vanguard
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests