Vcenter License Key Command Line
Using vSphere CLI (vicli)
If hosts are managed by vCenter, use Set-VMHost :
vcenter.system.info
$assignmentMgr = Get-View $licenseMgr.LicenseAssignmentManager $assignmentMgr.UpdateAssignedLicense($si.Content.About.InstanceUuid, $licenseKey, $null) Use code with caution. Copied to clipboard vcenter license key command line
For vCenter appliance licensing:
vicli -s <vcenter-server> -u <username> -p <password>
Connect-VIServer vcenter.example.com
New-VMwareLicense -Key "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
- Enable SSH in vCenter appliance settings.
- SSH to the VCSA.
- Switch to the appliance shell (if you are in the restricted shell, type
shell).
$LicenseAssignmentManager = Get-View $LicenseManager.LicenseAssignmentManager $LicenseAssignmentManager.UpdateAssignedLicense($vCenter.InstanceUuid, $LicenseKey, $null) Use code with caution. Copied to clipboard Using vSphere CLI (vicli) If hosts are managed