VMware Cloud Community
GaneshNetworks

Script to list out VMs, Hardware Type, CPU information of ESX servers

I am trying to prepare an excel sheet with the below information:
  
Column1: ESX server name
Column2: Virtual Machines name
Column3: Hardware Type (eg: HP, Dell, etc.,)
Column4: CPU information (No of CPU and its speed).
  
I tried to collect above those information with the below script. Everything is good except the "Column2". Please solve it.
  
Get-VMHost |Sort Name |Get-View |
Select Name,
@{N=“VM Name“;E={($_.Get-VM).VM.Name}}
@{N=“Type“;E={$_.Hardware.SystemInfo.Vendor+ “ “ + $_.Hardware.SystemInfo.Model}},
@{N=“CPU“;E={“PROC:“ + $_.Hardware.CpuInfo.NumCpuPackages + “ CORES:“ + $_.Hardware.CpuInfo.NumCpuCores + “ MHZ: “ + [math]::round($_.Hardware.CpuInfo.Hz / 1000000, 0)}} | Export-Csv c:\ESXinfo.csv
  
Thanks in advance,
Ganesh
~GaneshNetworks™~ If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
1 Reply
mattboren
Expert
Expert

Hello, GaneshNetworks-

This cross/double post was answered in the PowerShellers community at http://communities.vmware.com/message/1815747#1815747.  You will find a great answer there.

0 Kudos