A blog about my exerience with Clouds, Automation and Virtualization
A PowerCLI function to manage VMware vSphere Licenses
As always ( or at least in my world) you should do everything in powershell/powerCLI. Now the turn comes to handling licensing in VMware vSphere.
I searched the web and found some information from Luc Dekens post and from Joe Keegan post. I also used the Onyx VMware fling to get some more functionality.
I decided to do some powershell functions and came up with the following, I have created three functions that can do some magic with your licenses
Get-vLicense – query the vCenter for licenses
Add-vLicense – add a license or assign an existing license to a host/vCenter
Remove-vLicense – remove a license that is not in use
Of course there might be other things regarding licensing i have forgot but see this as a version 0.1 and that you can give me input on what to add or change
Here you can see how the function get the information:
You have to bare with me and my paintbrush skills, but I cannot show my license keys on the Internet
I can also use a switch to just show the ones that are not used with
Amazing script, thanks a lot. I prefer to apply new licensing for all ESXi in datacentrename
get-vmhost -Location datacentrename | ForEach-Object {Add-vLicense $_.name -LicenseKey ******************************}
I had some issue with essentials edition, but fixed it replacing line 75 with :
if ($LicenseType.EditionKey -like “vc*”){
to catch vc.essentials.instance type.
Thx for this usefull script !
I can’t find the name that we manually set while adding a license.It’s the filed callled “license” in the GUI. This is required for me to find back the correct license to use. Is there anyway to find it with your function ? I checked also the advanced properties from your script but it does not show the field with the name.
Comments
Hi,
Very good functions !
But I don’t know how to add license for my vCloud Networking & Security extension.
How could I find its UUID ?
Thanks !
Big thanks! really helps to add licenses, exactly what I was looking for!
Amazing script, thanks a lot. I prefer to apply new licensing for all ESXi in datacentrename
get-vmhost -Location datacentrename | ForEach-Object {Add-vLicense $_.name -LicenseKey ******************************}
I had some issue with essentials edition, but fixed it replacing line 75 with :
if ($LicenseType.EditionKey -like “vc*”){
to catch vc.essentials.instance type.
Great script ! thanks !
Hello,
Thx for this usefull script !
I can’t find the name that we manually set while adding a license.It’s the filed callled “license” in the GUI. This is required for me to find back the correct license to use. Is there anyway to find it with your function ? I checked also the advanced properties from your script but it does not show the field with the name.
Thx