Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

PowerCLI one-liner Reporting, Assigning, Changing and Removing licenses on ESXi

I was looking for instant one-liner PowerCLI script to get licensing report of ESXi servers and also wanted one-liner commands to assign / remove licenses on ESXi servers, Below scripts help to do the tasks.

#Connect ESXi Server
$vmHost = Get-VMHost -Name ironman.vcloud-lab.com

#Assign / Remove Evaluation license to ESXi server
Set-VMHost -VMHost $vmHost -LicenseKey 00000-00000-00000-00000-00000

#Assign 25 digit separated by - into five batches to ESXi server
Set-VMHost -VMHost $vmHost -LicenseKey ABC12-ABC12-ABC12-ABC12-ABC12

#Get ESXi assigned license information
Get-VMHost -Name ironman.vcloud-lab.com | Select-Object Name, LicenseKey 

Download Set-EsxiLicenses.ps1 here, This script is also available on github.com/kunaludapi.

To get ESXi only report there is a LicenseKey property on Get-VMHost. Next if you want to remove or assign evaluation key 00000-00000-00000-00000-00000 use LicenseKey parameter with Set-VMHost.

vmware powercli vcenter vsphere esxi vmhost get-vmhost name select licensekey set-host licensekey evaluation key 25 digit key license crack vsphere 7.png

To assign or change a actual license you use same Set-VMHost with LicenseKey parameter.

vmware powercli vcenter vsphere esxi vmhost get-vmhost name select licensekey set-vmhost licensekey evaluation key 25 digit key license crack vsphere 7.png.png

Useful Articles
Powercli Get vCenter assigned licenses report
Administrating licenses in vSphere client
Powercli Get vCenter licenses information

Go Back

Comment

Blog Search

Page Views

4142984

Follow me on Blogarama