VMware Cloud Community
bravestar83
Contributor
Contributor

Licensing Product Name of esxi host

Hi all!

How do i get the licensing information for a specific host using powercli.

From vCenter it is simple enough host -> configure -> Licensing 

I'm specifically looking from product name.

using 

$vmh = Get-VMHost -Name ”vmhost”
$vmh.ExtensionData.config.product
 
Returns
 
Name : VMware ESXi
FullName : VMware ESXi 7.0.3 build-21686933
Vendor : VMware, Inc.
Version : 7.0.3
PatchLevel : 0.90
Build : 21686933
LocaleVersion : INTL
LocaleBuild : 000
OsType : vmnix-x86
ProductLineId : embeddedEsx
ApiType : HostAgent
ApiVersion : 7.0.3.0
InstanceUuid :
LicenseProductName : VMware ESX Server
LicenseProductVersion : 7.0
 
You would think LicenseProductName is what im looking for but it does not match what is showing in vcenter which is "vSphere 7 Enterprise Plus"
 
Any help would be appreciated
Labels (1)
Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

There are quite a few threads in this community on that subject.
For example
Solved: Re: Unable to get License Info from multiple vCent... - VMware Technology Network VMTN

Re: Fetch ESXi license name & expiration date with... - VMware Technology Network VMTN

A search should produce more examples


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Dharzhak
Enthusiast
Enthusiast

The license information is largely separate from the VMHost object. It's queried from the vCenter License Manager service as the links provided by @LucD show. The "Product Name" is actually the Name property of the license object. A super quick way to query the license your host is using is this way:

> $VIConnection = Connect-VIServer -Server $VIServer -Credential $ViCreds
> $VMHostObj = Get-VMHost -Name "vmhost"
> $LicenseMgr = Get-View $VIConnection.ExtensionData.Content.LicenseManager
> $LicenseMgr.Licenses | Where-Object {$_.LicenseKey -eq $VMHostObj.LicenseKey}


LicenseKey : JUST0-SOME0-RANDM-TEXT0-CHARS
EditionKey : esx.enterprisePlus.cpuPackageCoreLimited
Name : vSphere 7 Enterprise Plus
Total : 18
Used : 12
CostUnit : cpuPackage:32core
Properties : {LicenseInfo, ProductName, ProductVersion, FileVersion...}
Labels :

(The license key is fake for obvious reasons.)

Reply
0 Kudos