Get-License -Key "XXXXX" | Select-Object Total, Used You must first unassign from all hosts and vCenter itself. Using PowerCLI:
First, get the host’s (MoRef):
/usr/lib/vmware-vcenter-license-service/scripts/license.py remove --id <license-id> This is done by editing the host's configuration via the vim-cmd tool (which communicates with vCenter's managed object broker). vcenter license key command line
# Get the host's moref (e.g., ha-host, domain-c1234) vim-cmd vimsvc/auth/luid vim-cmd vimsvc/license --assign <license-key> <moref> Get-License -Key "XXXXX" | Select-Object Total, Used You
$licenses = Get-License $today = Get-Date $warningDays = 30 foreach ($lic in $licenses) if ($lic.ExpirationDate -and $lic.ExpirationDate -ne [DateTime]::MaxValue) $daysLeft = ($lic.ExpirationDate - $today).Days if ($daysLeft -le $warningDays -and $daysLeft -ge 0) Write-Warning "License $($lic.Key) expires in $daysLeft days on $($lic.ExpirationDate)" elseif ($daysLeft -lt 0) Write-Error "License $($lic.Key) expired on $($lic.ExpirationDate)" you can use:
vim-cmd vimsvc/license --list vim-cmd vimsvc/license --remove <moref> This reverts the host to evaluation mode (60 days). C. The Deprecated Windows vCenter Tool: licensesvc If you are still on a Windows-based vCenter (6.x or earlier), you can use: