can someone explain how to get a list and count of all my vms that are running windows?
thanks
You can get a list of all your virtual machines that are running Microsoft Windows with:
Get-VM | ` Where-Object {$_.Guest.ExtensionData.GuestFamily -eq "windowsGuest"}
You can get the total number of virtual machines running Microsoft Windows with:
(Get-VM | ` Where-Object {$_.Guest.ExtensionData.GuestFamily -eq "windowsGuest"} | ` Measure-Object).Count
Regards, Robert
I'm sure the snazzy script provided by RvdNieuwendijk works great, but I would just download RVtools here: http://www.robware.net/. I've found it to be really useful for several simple reporting scenarios. DL, install, point it at your vCenter, done.
If you end up using/liking it, drop Rob a few bucks!
Thanks,
Brent
thanks to both of you.
the strange thing is that they both give different numbers of VMs!!!
Robert, does your script only list powered on machines?
My script lists powered off virtual machines as well. RVTools by default also lists templates. And my script doesn't list templates. Maybe that is the difference.