## PowerCLI Reference

# Get-LicenseDataManager

## Synopsis

Returns the vSphere LicenseDataManager objects for the specified vSphere servers.

Syntax

Get-LicenseDataManager [[-Server] <VIServer[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Related Commands

Online version

Detailed Description

Returns the vSphere LicenseDataManager objects for the specified vSphere servers.
The LicenseDataManager object allows programmatic access to the vSphere licensing functionality and can be used to associate license data with vCenter Server inventory nodes. The license data consists of VMware licensing material and takes the form of a list of {license type id, license key} pairs. The inventory nodes which can be associated with license data are individual hosts or host containers, such as clusters, datacenters and datacenter folders. Presence of such license data makes it possible to support automatic licensing when hosts are added to a particular host container entity.
LicenseDataManager provides methods for retrieving, creating, modifying and removing associations between license data and inventory nodes.
For more information about LicenseDataManager type: Get-Help about_licensedatamanager

Parameters

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
Server | VIServer[] | Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. | false | true (ByValue)
InformationAction | ActionPreference |  | false | false
InformationVariable | String |  | false | false
PipelineVariable | String |  | false | false

Return Type

LicenseDataManager

Notes

Get-LicenseDataManager is supported only on servers that are vCenter Server 5.0 or later.

Examples

-------------- Example 1 --------------

    Connect-VIServer -Server 10.23.112.235

    $licenseDataManager = Get-LicenseDataManager

    $licenseDataManager.QueryEntityLicenseData()

Retrieves all entity<->license data associations.

-------------- Example 2 --------------

    $viServer = Connect-VIServer -Server 10.23.112.235

    $licenseDataManager = Get-LicenseDataManager -Server $viServer

    $hostContainer = Get-Datacenter -Name Datacenter1

    $licenseDataManager.QueryAssociatedLicenseData($hostContainer.Uid)

Retrieves the license data associated with Datacenter1.

-------------- Example 3 --------------

    $viServer = Connect-VIServer -Server 10.23.112.235

    $licenseDataManager = Get-LicenseDataManager -Server $viServer

    $licenseData = New-Object Vmware.VimAutomation.License.Types.LicenseData

    $licenseKeyEntry = New-Object Vmware.VimAutomation.License.Types.LicenseKeyEntry

    $licenseKeyEntry.TypeId = "vmware-vsphere"

    $licenseKeyEntry.LicenseKey = "00000-11111-11111-11111-11111"

    $licenseData.LicenseKeys += $licenseKeyEntry

    $hostContainer = Get-Datacenter -Name Datacenter1

    $licenseDataManager.UpdateAssociatedLicenseData($hostContainer.Uid, $licenseData)

Associates new license data with Datacenter1. The license data holds single license key entry suitable for licensing vSphere hosts.

-------------- Example 4 --------------

    $viServer = Connect-VIServer -Server 10.23.112.235

    $licenseDataManager = Get-LicenseDataManager -Server $viServer

    $hostContainer = Get-Datacenter -Name Datacenter1

    $licenseDataManager.UpdateAssociatedLicenseData($hostContainer.Uid, $null)

Removes the license data (if any) associated with Datacenter1.

-------------- Example 5 --------------

    $viServer = Connect-VIServer -Server 10.23.112.235

    $licenseDataManager = Get-LicenseDataManager -Server $viServer

    $hostContainer = Get-Datacenter -Name Datacenter1

    $licenseDataManager.QueryEffectiveLicenseData($hostContainer.Uid)

Retrieves the merged license data associated with Datacaneter1 and its host container predecessors (in the context of the inventory) (if such predecessors exist and if they are associated some license data). The data is merged in bottom-up fashion such that there is only one license key entry per type id (e.g. child license key entry for a license type id is with higher priority). The resulting merged license data is the effective data used for automatic licensing when vSphere host is added to Datacenter1.

-------------- Example 6 --------------

    $viServer = Connect-VIServer -Server 10.23.112.235

    $licenseDataManager = Get-LicenseDataManager -Server $viServer

    $host = Get-VMHost -Name Host1

    $licenseDataManager.ApplyAssociatedLicenseData($host.Uid)

Applies the merged license data associated with Host1 and its host container predecessors (using the same rules as in QueryEffectiveLicenseData($host.Uid)) to Host1.

Copyright © VMware, Inc. All rights reserved.