ESX & ESXi counts: PowerCLI

Nothing too fancy here, just a quick and dirty way to find the current counts of all of my ESXi 4.1 (Build 260247) versus the remaining ESX hosts.

This really comes in handy when measuring the progress of upgrading from ESX 4.0 to ESXi 4.1.

$viserver = Connect-VIServer vcenter.domain.com -Protocol https
$vmhosts = Get-VMHost
$details = @()
$esx = 0
$esxi = 0
foreach ($vmhost in $vmhosts){
$detail = ""|select HostName,Version
$detail.Hostname = $vmhost.Name
$detail.Version = $vmhost.ExtensionData.Config.Product.FullName
$details += $detail
	if ($detail.Version -like "*260247") {
		$esxi = $esxi + 1
	} else {
		$esx = $esx+1
	}
}
Write-Output "ESX: " $esx
Write-Output "ESXi: " $esxi

Comments

  1. I do consider all the ideas you have introduced
    on your post. They’re very convincing and will certainly work.

    Nonetheless, the posts are too brief for beginners.

    May you please extend them a bit from subsequent time?
    Thanks for the post.

Trackbacks

  1. discount furniture stores in perth

    ESX & ESXi counts: PowerCLI — DAMIAN KARLSON

  2. coupon codes for barnes and noble online 2013

    ESX & ESXi counts: PowerCLI — DAMIAN KARLSON

Speak Your Mind

*