Looking for PowerShell commands - List all VMs

PowerShell script exchange

Looking for PowerShell commands - List all VMs

Veeam Logoby gmitchum » Mon Apr 03, 2017 9:16 pm

Looking for PowerShell commands - List all VMs...The key is to "Exclude the Exclusions".

I have about 300+ VMs & Templates excluded. I run a powershell report and it lists all the VMs that have been backed up (they meet the 24 hour parameter).
The issue is that the 300 that shouldn't get backed up show as missed. This list is sufficiently dynamic that a manually maintained list is unwieldy.
I thought that maybe if I defined a job as "Capture the VMs in "Discovered Virtual Machine" directory", (a dir was created for the excluded VMs and templates at the "VMs & Template" level) and it would only look there for the VMs of interest. Didn't seem to make a difference. The job ran fine, grabbing only the VMs in the specified directory, ignored the VMs & Templates in the "do not backup" directory and no exclusions listed in the job. Was GREAT.

Is there something I can do at the vCenter level to clean it up?

Posts: 1
Liked: never
Joined: Mon Apr 03, 2017 6:30 pm

Re: Looking for PowerShell commands - List all VMs

Veeam Logoby vmniels » Tue Apr 04, 2017 7:05 am

So you have a backup job and you need to know how to show the exclusions from that job via PowerShell?
Veeam Certified Engineer
Veeam Software
Posts: 1507
Liked: 325 times
Joined: Mon Jul 15, 2013 11:09 am
Full Name: Niels Engelen

Re: Looking for PowerShell commands - List all VMs

Veeam Logoby v.Eremin » Tue Apr 04, 2017 12:03 pm

What you can do is to

- Create two lists - VMs that were not processed within the last 24 hours (you already have this scripted) and VMs that were excluded from processing (this script)
- Compare them to find the same names
- Remove VMs that exist in two lists (delta)

Veeam Software
Posts: 13266
Liked: 968 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 2 guests