Get-LicenseDataManager

Returns the vSphere LicenseDataManager objects for the specified vSphere servers.

Syntax

[-Server  <VIServer[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
Server
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.

    Output

    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.

    Related Commands

    Feedback

    Was this page helpful?