VMware Cloud Community
Maelito77
Contributor
Contributor

PowerCLI Script to list all VM's OS

Hi

I need a get-view script to list guest VM OS so I can filter on the script W2K3/8/12 etc...

Thanks, Maelito

Maelito
Tags (1)
0 Kudos
2 Replies
vNEX
Expert
Expert

Hi,

hope this helps...

Get-View -ViewType VirtualMachine | Where { $_.Guest.GuestFullname} | Sort Name |Select-Object Name, @{N=”SelectedOS”;E={$_.Guest.GuestFullName}}, @{N=”InstalledOS”;E={$_.Summary.Config.GuestFullName}} | Out-GridView

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
jrmunday
Commander
Commander

You have two options to consider ...

A) Query the VM configuration to see what OS has been selected from the drop down (assuming this is 100% correct)

B) Query the guest OS to verify the version.

Both options can be done with PowerShell, and if you don't want to write the script yourself simply download RVTools and export all the data you need - http://www.robware.net/

Cheers,

Jon

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77
0 Kudos