VMware Cloud Community
fourpixels
Enthusiast
Enthusiast
Jump to solution

Licenses

Hi all,

I'm pretty new to VMware and PowerCLI and I've been given a task for license reconciliation. So we have 8 vCenters and when I check the report, most of the licenses keys are being shown as well to the other vCenters (is it linked?). So my questions right now, is there any way to have it accurately or are there any column that I could add to check where are these licenses really associated with?

Please kindly bear with me, just doing these stuffs for just a month now. Please see below the script

$report = 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='Product Version';E={$_.Properties | where{$_.Key -eq 'FileVersion'} | select -ExpandProperty Value}},

            @{N='LicenseName';E={$_.AssignedLicense.Name}},

      

            @{N='Product Edition';E={$_.Properties | where{$_.Key -eq 'ProductName'} | select -ExpandProperty Value}},

            @{N='Used License';E={$_.Properties | where{$_.Key -eq 'EntityCost'} | select -ExpandProperty Value}},

            

            @{N='Total';E={$_.AssignedLicense.Total}},

            @{N='ExpirationDate';E={$_.AssignedLicense.Properties.where{$_.Key -eq 'expirationDate'}.Value }}

    }}

$report | Export-Csv -NoTypeInformation -Path 'C:\temp\Lic_Info.csv' 

Thanks in advance!

Tags (2)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Since we seem to have same conversation also going on via email, I will continue here.

As I stated in my last response:

"To make sure what is happening, I suggest using the Web Client to connect to some of these vCenters.

And then check if the same license is present in multiple vCenters.

But since the report seems to already state that, I'm pretty sure you will find the same licenses in multiple vCenters.

This is allowed if a license is for example for 6 CPUs, and in each of the 3 vCenters only 2 CPUs are licensed."

Please do not post license keys in here!


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

5 Replies
sjesse
Leadership
Leadership
Jump to solution

I suggest moving this to the powercli seciton, you can do it if you edit the question, as you will most likely receive a better response.

0 Kudos
fourpixels
Enthusiast
Enthusiast
Jump to solution

Thanks! Just moved it now

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Since we seem to have same conversation also going on via email, I will continue here.

As I stated in my last response:

"To make sure what is happening, I suggest using the Web Client to connect to some of these vCenters.

And then check if the same license is present in multiple vCenters.

But since the report seems to already state that, I'm pretty sure you will find the same licenses in multiple vCenters.

This is allowed if a license is for example for 6 CPUs, and in each of the 3 vCenters only 2 CPUs are licensed."

Please do not post license keys in here!


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

fourpixels
Enthusiast
Enthusiast
Jump to solution

Thanks for the info LucD. So basically our goal is to get the total license being used but seems that as you've mentioned that this is allowed, I am thinking right now the best way on how to get the total quantity because it will be shown as duplicate if I add those numbers.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That would be the best approach imho.

You can use the Group-Object cmdlet on the LicenseKey property.

Then the summarise the Used Licenses to get the total per license key.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference