Remove RDS CALs from RDS Server


There are many circumstances where you will need to remove a RDS CALs from an RDS Server, or in some cases you want to rebuild the entire RD licensing database.  Microsoft allows you to remove an individual CAL license pack using powershell, or rebuild the entire database.  However, if neither of those work, it’s quite easy to manually rebuild the RD licensing database.  I’ve included directions for all 3 methods below, and have tested this on Windows Server 2008, 2008R2, 2012, 2012R2, and 2016.

Remove An Individual RDS CAL License Pack Using Powershell (User or Device CAL)

  • Open powershell elevated as an administrator
  • Type the following command to list the RDS Licenses and note the KeyPackID
    • Alternatively, open RD Licensing Manager and note the Keypack ID

  • Run the below command to remove the licenses pack from your RD Server
    • Replace KEYPACKID with the number you obtained above


Rebuild the RD Licensing Database

Microsoft provides directions on how to do this automatically, via a web browser, or via the phone:


Manually Rebuild the Licensing Database (Guaranteed to Work if the Previous 2 methods Fail)

  • Make sure you have documentation of your MS License agreement that includes Authorization number, License number, License type (User/Device CAL), and Quantity before proceeding
  • Stop the Remote Desktop Licensing service

Stop Remote Desktop Licensing Service

  • Rename C:\Windows\System32\lserver\TLSLic.edb to C:\Windows\System32\lserver\TLSLic.old
  • Start the Remote Desktop Licensing service
  • All licenses will now be cleared out of RD Licensing Manager, and you’ll need to re-install the licenses you want to add back in

7 thoughts on “Remove RDS CALs from RDS Server

  1. Forgive me for asking, but in the second command line you use the word “namespace” without any explanation and then, my personal favorite “Replace KEYPACKID with the number you obtained from above”…
    The command you have there doesn’t have the word KEYPACKID!!!

    Help please? Perhaps a little clarity for the newbie?!?!

    • It’s just the syntax used for the wmic command, same as using a WMI namespace. If you want to read more details on WMIC, I’d suggest reading about it on MSDN

      KEYPACKID is the last thing in the command. There’s a little scroll bar because it’s a long command. You can either scroll over or click the “Copy” button which will highlight the full command and tell you to press CTRL + C. You can then paste it into a text editor to better read/manipulate

  2. Thanks for this! Needed to remove just that last CAL added and re-add due to an error in listing the number of licenses. I did not want to have to rebuild the db and clear all entries. Worked perfectly

  3. Thanks, Rename C:\Windows\System32\lserver\TLSLic.edb to C:\Windows\System32\lserver\TLSLic.old
    Start the Remote Desktop Licensing service
    This work for me but Although I purchased RDS 5 qty license, unable to use. Error showing only two license can be use.

  4. Pingback: Remove An Individual RDS CAL License Pack Using Powershell (User or Device CAL) – VMDK 自修室

Leave a Reply

Your email address will not be published. Required fields are marked *