powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-LicenseDataManager



NAME
Get-LicenseDataManager

SYNOPSIS
Returns the vSphere LicenseDataManager objects for the specified vSphere servers.

SYNTAX
Get-LicenseDataManager [[-Server] ] []


DESCRIPTION
Returns the vSphere LicenseDataManager objects for the specified vSphere servers.

LicenseDataManager allows for extending the vCenter Server inventory with license data associated with inventory no
des. The license data consists of VMware licensing material and takes the form of a list of {license type id, licen
se key} pairs. The inventory nodes which can be associated with license data are individual hosts or host container
s, 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 d
ata and inventory nodes.

For more information about LicenseDataManager type: Get-Help about_licensedatamanager


PARAMETERS
-Server
Specifies the vCenter servers on which to run the cmdlet. If no value is given to this parameter, the command r
uns on the default servers. For more information about default servers, see the description of Connect-VIServer
.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
LicenseDataManager


NOTES


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

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

C:\PS>Connect-VIServer -Server 10.23.112.235

$licenseDataManager = Get-LicenseDataManager

$licenseDataManager.QueryEntityLicenseData()


Retrieves all entity<->license data associations.





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

C:\PS>$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 --------------

C:\PS>$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 licensin
g vSphere hosts.





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

C:\PS>$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 --------------

C:\PS>$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 lic
ense type id is with higher priority). The resulting merged license data is the effective data used for automatic l
icensing when vSphere host is added to Datacenter1.





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

C:\PS>$viServer = Connect-VIServer -Server 10.23.112.235

$licenseDataManager = Get-LicenseDataManager -Server $viServer

$hostContainer = Get-Datacenter -Name Datacenter1

$licenseDataManager.ApplyAssociatedLicenseData($hostContainer.Uid)


Applies the merged license data associated with Datacaneter1 and its host container predecessors (using the same ru
les as in QueryEffectiveLicenseData($hostContainer.Uid)) to all hosts that reside in Datacenter1.






RELATED LINKS
Online version: