PowerShell script exchange
Post Reply
Kazz
Expert
Posts: 140
Liked: 17 times
Joined: Feb 08, 2018 3:47 am
Full Name: Kazz Beck
Contact:

get VMs from multiple jobs

Post by Kazz »

Hi,

I have 75+ jobs that have Local in the job name. Ex: abclocal-job11, xzylocal-job21, yxzlocal_VMs_job11
I need to get a report of all VMs from the jobs that have DEV or TEST in the VM name.

Does anyone have a script that does exactly that or maybe a script that partially does what I am looking for?

Thanks
Mildur
Product Manager
Posts: 8735
Liked: 2294 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: get VMs from multiple jobs

Post by Mildur » 1 person likes this post

Hi Kazz

A simple query to get all vm with such names:

Code: Select all

Get-VBRJob | where {$_.name -like "*local*"} | Get-VBRJobObject | Where-Object {$_.Name -like "*DEV*" -or $_.name -like  "*TEST*"}
Best,
Fabian
Product Management Analyst @ Veeam Software
Kazz
Expert
Posts: 140
Liked: 17 times
Joined: Feb 08, 2018 3:47 am
Full Name: Kazz Beck
Contact:

Re: get VMs from multiple jobs

Post by Kazz »

Exactly what I needed

Thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests