0

I am trying to get the VMHost operating system info , but I can not find the required scripts. I tired this :-

Get-VMHost 

which return a lot of info about the VMHost,, but the operating system info is missing. can anyone advice how I can get the operating system info?

yagmoth555
  • 16,300
  • 4
  • 26
  • 48
John John
  • 339
  • 1
  • 4
  • 12

1 Answers1

5

What information do you actually want to get?

Get-VMHost has a field for build. This will give you the ESXi build number, which is a more reliable way of telling which version of ESXi you are on than the version number (as the build number also accounts for patches and mid version updates). There is also a field for Version There's also a field for LicenseKey if you want to know which one of your licenses you're running on.

If you want to see the most common fields for a Powershell cmdlet, the easiest way to do this is Get-VMHost | Format-List and then you'll get much more detail than just the cmdlet on its own.

e.g:

Get-VMHost | fl

WARNING: The 'State' property of VMHost type is deprecated. Use the
'ConnectionState' property instead.
State                 : Connected
ConnectionState       : Connected
PowerState            : PoweredOn
VMSwapfileDatastoreId :
VMSwapfilePolicy      : Inherit
ParentId              : ClusterComputeResource-domain-c7
IsStandalone          : False
Manufacturer          : Dell Inc.
Model                 : PowerEdge R710
NumCpu                : 12
CpuTotalMhz           : 28716
CpuUsageMhz           : 2746
LicenseKey            : ABCD-LOLNOPE-XYZ
MemoryTotalMB         : 196595.01953125
MemoryTotalGB         : 191.987323760986328125
MemoryUsageMB         : 69411
MemoryUsageGB         : 67.7841796875
ProcessorType         : Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
HyperthreadingActive  : True
TimeZone              : UTC
Version               : 5.5.0
Build                 : 2718055
Parent                : Production Systems
VMSwapfileDatastore   :
StorageInfo           : HostStorageSystem-storageSystem-10
NetworkInfo           : vm02:example.com
DiagnosticPartition   : naa.6782bcb02fa43900158b53260918e349
FirewallDefaultPolicy : VMHostFirewallDefaultPolicy:HostSystem-host-10
ApiVersion            : 5.5
Name                  : vm02.example.com
CustomFields          : {}
ExtensionData         : VMware.Vim.HostSystem
Id                    : HostSystem-host-10
Uid                   : /VIServer=example\mark.henderson@vsphere-eq:443/VMHost=HostSystem-host-10/
Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
  • Great advice, but I would suggest the slightly different {Get-VMHost | Format-List * } because some objects have properties that only show up when you get the full results. The asterisk will force the full output. – Zach Bolinger Aug 26 '15 at 13:40