PowerCLI Get ESXi Host and Version

This script will connect to a vCenter server and list all hosts it can see and the version of ESXi running on the host. I have also exported this to a csv

Add-PSSnapinVMware.VimAutomation.Core

Connect-VIServer-Server vSphereServerName

Get-VMHost | Select Name,Version,@{N="vCenter";E={$_.ExtensionData.CLient.ServiceUrl.Split('/')[2]}} |ft name,version | Out-File FileLocation

Facebooktwittergoogle_pluslinkedinby feather

Leave a Reply

Your email address will not be published. Required fields are marked *