To uninstall License Keypacks or reduce the number of installed licenses, you can use the Remote Desktop License Server WMI Provider.
For example, if you only need to reduce the number of installed licenses in one of the keypacks from 30 to 25, you can use the RemoveLicensesWithIdCount method.
You can find the documentation for the Win32_TSLicenseKeyPack class at the following link:
http://msdn.microsoft.com/en-us/library/aa383803(v=VS.85).aspx
Basic steps to reduce the number of licenses in a KeyPack
- Access your server using Remote Desktop.
- Open the Windows Command Prompt (CMD).
- Get a list of installed keypacks using the following commands:
wmic /namespace:\\root\CIMV2 PATH Win32_TSLicenseKeyPack>keypacks.txt
notepad keypacks.txt - Once you have the KeyPackId of the license keypack you want to uninstall, follow this example:
Let's say the keypack you want to uninstall has the KeyPackId 3. In that case, you should enter the following command:
wmic /namespace:\\root\CIMV2 PATH Win32_TSLicenseKeyPack CALL UninstallLicenseKeyPackWithId 3
As shown in this example, the number after “UninstallLicenseKeyPackWithId” indicates the ID of the license keypack.