For most users, you probably have a large collection of vSphere license keys that have been provisioned over the years and keeping track of the product SKU, entitled features and capacity can be a challenge, especially if you are just looking at the raw 25 character license string.
While the Broadcom Support Portal (BSP) is recommended for all license management operations(view, split, merge, etc), did you know you could also use vCenter Server to help decode a particular license key?
When you attempt to add a valid license key (ESXi, vCenter, vSAN or Tanzu) to a vCenter Server, it provides a preview of the product SKU features and capacity, where it decodes the 25 character license string into something more meaningful.
With this information, we replicate the same behavior by using the vSphere API and specifically the decodeLicense method to decode a specific license key that vCenter Server understands.
To demonstrate this functionality, I have created a PowerCLI function called Decode-VMwareLicense that will allow users to specify one or more license keys and it will automatically decode the product SKU, Capacity, Unit, Expiration, entitled components and features for each license key.
Step 1 - Download DecodeVMwareLicense.ps1 to your local system
Step 2 - Source the Decode-VMwareLicense function by running the following command:
. ./DecodeVMwareLicense.ps1
Step 3 - Connect to one of your vCenter Server using the Connect-VIServer cmdlet
Step 4 - Run the following command with an array of license keys that you wish to decode:
Decode-VMwareLicense -LicenseKeys @("AAAA","BBB","CCC","DDD")
Here is an example output for decoding four license keys that translates to vSphere Enterprise Plus, vSAN Enterprise, vSphere Enterprise Plus for VCF and vSphere Enterprise Plus for VVF:
Bruce Ferrell says
Just out of curiosity, can this determine is this is an eval license vs a purchased license?
I've had instance in which evals were applied and presented a purchased... Needless to say, hilarity ensued.
William Lam says
Yup. Eval is easy as the license key will show all zeros