Ever wanted to check the hosts in your vCenter to make sure they are all the same type, you can use the following one liner to do this:
Get-VMHost | Sort Name | Get-View | Select Name, @{N=“CPU“;E={$_.Hardware.CpuPkg[0].Description}} | Export-Csv c:\cpuinfo.csv
Sample Output:
| Name | CPU |
| tesesx01.mydomain.com | Intel(R) Xeon(R) CPU 5160 @ 3.00GHz |
| tesesx02.mydomain.com | Intel(R) Xeon(R) CPU 5160 @ 3.00GHz |
| tesesx03.mydomain.com | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx04.mydomain.com | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx05.mydomain.com | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx06.mydomain.com | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx07.mydomain.com | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
Or if you want to add the cluster name in there as well:
Get-VMHost | Sort Name | Get-View | Select Name, @{N=“Cluster“;E={Get-Cluster -VMHost (Get-VMHost $_.Name)}},@{N=“CPU“;E={$_.Hardware.CpuPkg[0].Description}} | Export-Csv c:\cpuinfo.csv
Sample Output:
| Name | Cluster | CPU |
| tesesx01.mydomain.com | Test | Intel(R) Xeon(R) CPU 5160 @ 3.00GHz |
| tesesx02.mydomain.com | Test | Intel(R) Xeon(R) CPU 5160 @ 3.00GHz |
| tesesx03.mydomain.com | Production | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx04.mydomain.com | Production | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx05.mydomain.com | Production | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx06.mydomain.com | Production | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
| tesesx07.mydomain.com | Production | Intel(R) Xeon(R) CPU E5450 @ 3.00GHz |
