PowerShell script exchange
Post Reply
gmitchum
Novice
Posts: 3
Liked: never
Joined: Apr 03, 2017 6:30 pm
Contact:

Looking for PowerShell commands - List all VMs

Post by gmitchum »

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?

Suggestions?
nielsengelen
Product Manager
Posts: 5634
Liked: 1181 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Looking for PowerShell commands - List all VMs

Post by nielsengelen »

So you have a backup job and you need to know how to show the exclusions from that job via PowerShell?
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Looking for PowerShell commands - List all VMs

Post by veremin »

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)

Thanks.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 16 guests