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


[-Server  <VIServer[]>]


Required Parameter Name Type Position Features Description
VIServer[] named
  • wildcards
  • pipeline
  • 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.



    Example 1

    Connect-VIServer -Server
    $licenseDataManager = Get-LicenseDataManager

    Retrieves all entity<->license data associations.

    Example 2

    $viServer = Connect-VIServer -Server
    $licenseDataManager = Get-LicenseDataManager -Server $viServer
    $hostContainer = Get-Datacenter -Name Datacenter1

    Retrieves the license data associated with Datacenter1.

    Example 3

    $viServer = Connect-VIServer -Server
    $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
    $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
    $licenseDataManager = Get-LicenseDataManager -Server $viServer
    $hostContainer = Get-Datacenter -Name Datacenter1

    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
    $licenseDataManager = Get-LicenseDataManager -Server $viServer
    $host = Get-VMHost -Name Host1

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

    Related Commands


    Was this page helpful?