ESXi procesor information report – Powercli script
Simple scirpt to generate csv file with procesor information of your esxi hosts
Script
if (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue))
{
Add-PSSnapin VMware.VimAutomation.Core > $null
}
Connect-VIServer vc01.lab.local
$VMHosts = Get-VMHost
$Inventory = ForEach ($VMHost in $VMHosts)
{
“” | Select-Object -Property @{N=”Name”;E={$VMHost.Name}},
@{N=”Vendor”;E={(Get-View -ViewType HostSystem -Filter @{“Name” = $VMHost.Name}).Hardware.Systeminfo.Vendor}},
@{N=”Model”;E={(Get-View -ViewType HostSystem -Filter @{“Name” = $VMHost.Name}).Hardware.Systeminfo.Model}},
@{N=”CPU Model”;E={$VMHost.ExtensionData.Summary.Hardware.CpuModel}},
@{N=”Datacenter”;E={(Get-Datacenter -VMHost $VMHost.Name).Name}},
@{N=”Cluster”;E={(Get-Cluster -VMHost $VMHost.Name).Name}},
@{N=”Hypervisor”;E={$VMHost.Extensiondata.Config.Product.Name}},
@{N=”Hypervisor Version”;E={$VMHost.Extensiondata.Config.Product.Version}},
@{N=”Clock Speed (Mhz)”;E={$VMHost.ExtensionData.Summary.Hardware.CpuMhz}},
@{N=”Memory (MB)”;E={$VMHost.MemoryTotalMB}},
@{N=”Hyperthreading Enabled”;E={$VMHost.HyperThreadingActive}},
@{N=”Number of Cores”;E={$VMHost.ExtensionData.Summary.Hardware.numCpuCores}}
}
$Inventory | Export-Csv -NoTypeInformation -Path (“D:\Output\” + [guid]::NewGuid() + “-inv_hosts.csv”)
Please Comment and Subscribe