Syntax
Get-LicenseDataManager [[-Server] <VIServer[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]Related Commands
Online versionDetailed Description
Returns the vSphere LicenseDataManager objects for the specified vSphere servers.Parameters
Return Type
LicenseDataManagerNotes
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.