7.0

Table Of Contents
2 Run a cmdlet that retrieves the data center in which the hosts for which you want to use the
bulk licensing feature are located.
$hostContainer = Get-Datacenter -Name Datacenter-X
You can also run a cmdlet that retrieves a cluster to use bulk licensing for all hosts in a cluster,
or retrieves a folder to use bulk licensing for all hosts in a folder.
3 Create a LicenseData object and a LicenseKeyEntry object with associated type ID and license
key.
$licenseData = New-Object VMware.VimAutomation.License.Types.LicenseData
$licenseKeyEntry = New-Object Vmware.VimAutomation.License.Types.LicenseKeyEntry
$licenseKeyEntry.TypeId = "vmware-vsphere"
$licenseKeyEntry.LicenseKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
4 Associate the LicenseKeys attribute of the LicenseData object you created in step 3 with the
LicenseKeyEntry object.
$licenseData.LicenseKeys += $licenseKeyEntry
5 Update the license data for the data center with the LicenseData object and verify that the
license is associated with the host container.
$licenseDataManager.UpdateAssociatedLicenseData($hostContainer.Uid, $licenseData)
$licenseDataManager.QueryAssociatedLicenseData($hostContainer.Uid)
6 Provision one or more hosts with vSphere Auto Deploy and assign them to the data center or
to the cluster that you assigned the license data to.
7 You can use the vSphere Client to verify that the host is successfully assigned to the default
license XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.
Results
All hosts that you assigned to the data center are now licensed automatically.
Managing vSphere Auto Deploy with PowerCLI Cmdlets
You can manage vSphere Auto Deploy with PowerCLI cmdlets to create rules that associate hosts
with image profiles, host profiles, custom scripts and locations on the vCenter Server target. You
can also update hosts by testing rule compliance and repairing compliance issues.
vSphere Auto Deploy PowerCLI Cmdlet Overview
You specify the rules that assign image profiles and host profiles to hosts using a set of PowerCLI
cmdlets that are included in PowerCLI.
If you are new to PowerCLI, read the PowerCLI documentation and review Using vSphere Auto
Deploy Cmdlets. You can get help for any command at the PowerShell prompt.
n Basic help: Get-Help
cmdlet_name
VMware ESXi Installation and Setup
VMware, Inc. 129