Hi,
I would like to fetch the license key of a single host
Am able to fetch list of license keys assigned in a vcenter, but unable to fetch host wise.
My requirement is , i will be connecting to vcenter and need to fetch license key for a single host which i feed as input.
Please help
The following PowerCLI command will return the name and license key for a host named ESX1:
Get-VMHost -Name ESX1 | Select-Object -Property Name,LicenseKey
You need at least PowerCLI version 5.5 Release 1 for the preceding command to work.
The following PowerCLI command will return the name and license key for a host named ESX1:
Get-VMHost -Name ESX1 | Select-Object -Property Name,LicenseKey
You need at least PowerCLI version 5.5 Release 1 for the preceding command to work.
oh yes.... Thanks RvdNieuwendijkRvdNieuwendijk
I was checking in get-Licensedatamanager and trying all other possible options via get-view, but missed this basic check..
Thanks a lot !!!
Hi
I need to get Licence of all the host from VC is there any command
Did you try this?
Get-VMHost | Select-Object -Property Name,LicenseKey
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
I have keys added to vCenter, each key represents a cluster, is there any scripted method to apply a key to a host I could then loop for every host in a cluster?
How would you pick which key goes to which cluster, or would that be random?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
When the keys are added to VCE ether I name them with the “cluster name - vSphere 6 Enterprise”
I was hoping to get key and assign to each host in a loop for that particular cluste.
I'm afraid you don't have access to those labels from the cmdlets nor the API.
You could store them in an external file, and then use the Label from there to pick the cluster and key
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Oh wait are you saying you can call it by the actual key, cause if so that’s fine because have a csv with all the labels and keys?
Yes, but check it out with the following to make sure.
$licMgr = Get-View licensemanager
$licMgr.Licenses
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
As always thanks again for your help.
Luc,
Is there a way to see the License assigned to a particular VC?
In a linked mode setup when you look at the license manager you will get all of the licenses but not what VC they are assigned to.
Get-View licensemanager will display all licenses but not what they are assigned to, unless I am missing something.
I am able to get the Information for each host through get-vmhost but i do not see the equivalent for VC
Thanks,
Greg
Try like this
foreach($vc in $global:DefaultVIServers){
$licMgr = Get-View LicenseManager -Server $vc
$licAssignmentMgr = Get-View -Id $licMgr.LicenseAssignmentManager -Server $vc
$licAssignmentMgr.QueryAssignedLicenses($vc.InstanceUid) | %{
$_ | select @{N='vCenter';E={$vc.Name}},EntityDisplayName,
@{N='LicenseKey';E={$_.AssignedLIcense.LicenseKey}},
@{N='LicenseName';E={$_.AssignedLicense.Name}},
@{N='ExpirationDate';E={$_.AssignedLicense.Properties.where{$_.Key -eq 'expirationDate'}.Value }}
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc,
This code worked very well for me. Thank you.
It is too bad that a LicenseKey attribute is not a part of the vCenter object such as it is the ESXi host object
Submit the idea!
VMware PowerCLI
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sorry to revive an older post but I'm having terrible time trying to find the get-view equivalent of this command. It must be buried somewhere in Get-View output?
Thanks!