Thursday, February 25, 2016

PowerCLI: Getting Host Hardware Information with Get-VMHostHardware

I was recently asked to gather the hardware specs for all of our ESXi hosts globally. 

Previously, I've used scripts to successfully gather this information.  However, I did a quick search and it looks like VMWare replaced a majority of their functionality with one cmdlet!  This is great for audit and management purposes.

Get-VMHostHardware

This cmdlet was introduced in PowerCLI 6.0 R2 and retrieves the following information:
VMHost    
Manufacturer    
Model    
SerialNumber   
AssetTag   
BiosVersion    
CpuModel    
CpuCount    
CpuCoreCountTotal    
MhzPerCpu    
MemorySlotCount    
MemoryModules    
PowerSupplies   
NicCount

Example Output against one ESXi host:
Get-VMHostHardware -vmhost MyHost.MyDomain.com | fl



All I did was connect to all of our vCenter servers in PowerCLI and run the following one-liner.  This got me nearly all the information I needed!

Get-VMHost | Get-VMHostHardware -SkipAllSslCertificateChecks | Export-Csv D:\VMHostHardware.csv

No comments:

Post a Comment