vCheck 1.14: Inactive machines count

I was looking through the vCheck Feature Request tracking spreadsheet that I’ve been working on for several months.  I found this comment that was originally posted in September 2010:

One of the Heading in the scripts says number of Inactive machines. What exactly it means that the machines are turned of or what. Secondly it doesnt list those VM’s. Can i have code for that please. Regards

Reviewing the code today, it appears this section was added back in the 1.14 version. The ‘Inactive VM’ section is simply a count of powered off virtual machines.  The following code will produce the actual list:

$FullVM = Get-View -ViewType VirtualMachine | Where {-not $_.Config.Template}
$FullVM | where { $_.Runtime.PowerState -eq "poweredOff" }

In version 5.35, a section title “Powered off VMs” was added that includes the last power on event time for each powered off server. I hope this helps!

This entry was posted in Scripting, Virtualization. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.