image

If you want a quick overview of your ESX servers, you can run the following script:

$vCenter = Read-Host "Enter the vCenter server name"

Connect-VIServer $vCenter

$vmhosts = get-vmhost * 
$vmhosts | Sort Name -Descending | % { $server = $_ |get-view; `
    $server.Config.Product | select `
    @{ Name = "Server Name"; Expression ={ $server.Name }}, `
    Name, Version, Build, FullName, ApiVersion }

Disconnect-VIServer -Confirm:$false
 

The output looks like this:

image

3 thoughts on “PowerCLI: Get ESX version info

  1. Now what you need to do is read the htm file from the VMware website and correspond the version numbers to actual versions 😉 Something I was thinking about doing a while back.

    1. That would be cool, but very unlogical at the same time. Since your buildnumbers increase with every update you do on ESX.

      If you install the “bare-ISO” then you will have the default build that is indeed displayed on the download page on the VMware website. But after every installation I immidiately run the updates through the Update Manager plugin to update it with the latest patches/updates before I put any server in production.

      So, that would mean that the script will immidiately stop matching with the latest buildnumber that is available for download on the website because the version that is running in your cluster is actually newer.

      What would be a better option, which I considered myself is to put all the versions of all servers in a cluster in an array and take the highest buildnumber (the server with the latest updates) and display which servers are running behind with updates.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.