Book Image

Learning PowerCLI for VMware VSphere

By : Robert van den Nieuwendijk
Book Image

Learning PowerCLI for VMware VSphere

By: Robert van den Nieuwendijk

Overview of this book

Table of Contents (17 chapters)
Learning PowerCLI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Managing licenses


While writing this book, there are no PowerCLI cmdlets to add, retrieve, update, or remove licenses. You have to use the vSphere API to manage licenses in PowerCLI. There is only one cmdlet in PowerCLI for license management, Get-LicenseDataManager, and the only thing this cmdlet does is expose a hidden vSphere API.

You will use the vSphere API objects LicenseManager, LicenseAssignmentManager, and the hidden LicenseDataManager object to manage licenses.

You need to use LicenseManager to manage licenses in the license inventory on your vCenter Server. You can use LicenseAssignmentManager to manage the assignment of licenses to the ESXi servers. You use LicenseDataManager to associate licenses with containers in your vSphere environment and enable automatic license assignment to hosts that are added to a container.

The following three commands will give you hooks to the vSphere API license objects:

PowerCLI C:\> $LicenseManager = Get-View -Id 'LicenseManager-LicenseManager...