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