Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows » How to Remove and Manage RDS Licenses

How to Remove and Manage RDS Licenses

Posted on 21/06/202209/06/2023 Imoh Etuk By Imoh Etuk No Comments on How to Remove and Manage RDS Licenses
CAL-Removal

According to Microsoft documentation, when an unlicensed client connects for the first time to a terminal server, the terminal server issues a temporary Terminal Server Client Access License (CAL) token to the client. The Terminal Server instructs the License Server to mark the issued temporary Terminal Server CAL token as validated after the user logs into the session. If you’re interested in learning more about RDS, see the following guides: How to install RDS via Quick Start Deployment: Install, Publish, how to Update and Uninstall Remote Desktop Web Client, What to do when your Remote Desktop Licensing Manager Server Crashed, and Publish Remote Desktop Web Client: How to install HTML 5 Web Client for Microsoft RDS Server. In this article, you will learn how to How to Remove and Manage RDS Licenses with PowerShell.

The validated temporary Terminal Server CAL token is upgraded to a complete Terminal Server CAL token the next time the client connects. The temporary Terminal Server CAL token will continue to work for 90 days if no licensing tokens are available. The license is saved in the registry of the client. Kindly refer to this related guide: How to remove a Remote Desktop Service collection on Windows Server.

How to Remove and Manage RDS Licenses with PowerShell

I will briefly explain how to rebuild or delete Terminal Server licenses from a Remote Desktop Protocol (RDP) client and state some useful PowerShell Cmdlets that can be used to manage the RDS CAL package in this article with a practical demonstration. In Windows 10 or 11, the License can be found in the System Registry as shown below.

Note that in 32-bit RDP clients license are under the key HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing

However, if you edit the registry incorrectly, major issues may arise. As a result, make sure you carefully follow these instructions. Make a backup of the registry before making any changes. If an issue arises, you can restore the registry.

Backing System Registry

The prerequisite to RDS CAL removal etc is to back up the system Registry, open the Run dialog box, and type "regedit /v" and then press the Enter Key

Run-command
Opening Registry in Windows

Right-click on “Computer” and select export to export the registry to a folder in your PC.

Backup-Registry
Exporting

Before we continue, let’s quickly show you how to backup the system Registry.

Clean the RDP client’s license cache

For 16-bit RDP clients, run regedit /v. Then delete the keys under \Software\Microsoft\MSLicensing to clean the client’s license cache. You can also delete the BIN files from \Windows\System\Regdata.

Delete-Ms-licensing
Deleting RDP Client Licenses

The license is stored in a file on the local computer in the folder hierarchy under /users/Shared/Microsoft/RDC Crucial Server Information/ by the RDP client for Macintosh. Delete the contents of this folder to clear the Macintosh client’s license cache. When the client reconnects, it will attempt to obtain a new license from the server.

If you delete the HKEY LOCAL MACHINE\Software\Microsoft\MSLicensing subkey on a Windows Vista or later client, subsequent attempts to connect to a Terminal Server may fail. You also get the following error message:

An Error occurred in the Licensing Protocol

To fix this, right-click the Remote Desktop Connection shortcut and choose Run as Administrator. The remote desktop connection is launched by default as a user with the lowest user permissions.

A restricted user does not have permission to write registry entries to HKEY_LOCAL_ MACHINE by default. Attempts to rewrite the MSLicensing key thus fail. Starting Remote Desktop Connection with administrative credentials grants the necessary permissions to write the required registry keys.

The above steps apply to local PC. Next, we will look at how to Rebuild or Remove RDS CALs from Windows RDS Server

How to Rebuild or Remove RDS CALs from Windows RDS Server

Why do we need to remove or delete the Remote Desktop License? The reason is that sometimes we need to add more users to the RDS CAL User type license, or we need to change the user type CAL to Device CAL, or the installed license has become corrupted. We can resolve such issues by rebuilding or deleting the current RDS License.

Such an issue could be like the one shown in the screenshot below:
CAL-Issues
CAl Issue

To resolve the license issue, from the left corner of the server dashboard locate and click on Remote Desktop Services.

Click-on-RD-Services

“Click on servers”

Click-on-Servers
Click on Servers

Manage Remote Desktop Licenses

After that, right-click on the server name and select “Manage Licenses” from the drop-down menu.

Manage-Lincenses-Option
Manage Licenses

The welcome to manage licenses wizard displays

Click-next
Welcome to manage license wizard

Now, click next to select the product version and license type and specify the quantity. Here, we select the RDS Per User CAL type

Product-Version-and-License
Product Version and License Type

Rebuild the license in the next interface and select the reason for rebuilding it from the drop-down menu.

Reason-for-Rebuilding-the-Database
Selecting Reason for Rebuilding the license

Next, is to choose a licensing program

Rebuilding-CAL-Choose-License-Program
Choose a License Program

Next, you have to confirm license deletion. Rebuilding the CAL license means the existing licenses that got corrupted will be deleted before rebuilding the new one.

Confirm-Deletion
Confirming Deletion

The screenshot below shows that the rebuilding of the license is in progress.

Reinstallation-in-Progress
Rebuilding License

After the license has finished rebuilding, we can now have a preview of the RD licenses installed

The-type-of-License-Used
Type of License Installed

Managing RDS CAL with PowerShell

Alternatively, you can manage the RDS CAL License via PowerShell.

To do so, launch PowerShell as an Administrator. From the search menu, search for and right-click on PowerShell to open it as an Administrator.

Open-PowerShell-as-Admin
Opening PowerShell with Admin Privileges

If you want to transfer your RDS CALs from one Remote Desktop Connection license server to another, you can remove the installed CAL license pack from the license server using PowerShell.

Using the following cmdlet, you can get the list of all the RDS CAL packages installed on the server:

Get-WmiObject
Displaying the list RDS CAL Packages

Execute the command below if you want to remove unused or corrupted Remote Desktop Licenses CALs from the RDS server:

wmic /namespace:\\root\CIMV2 PATH Win32_TSLicenseKeyPack CALL UninstallLicenseKeyPackWithId KeyPackID
Delete-CAl-Via-PowerShell
Deleting or Removing CAL.

The second command above also helps you find the KeyPackId value for the RDS CAL package that you want to remove.

You can also completely remove all CALs by recreating the RDS license database. To do this, stop the Remote Desktop Services licensing service:

Stop-Service TermServLicensing

After stopping or removing the CALS completely, rename the file:

C:\Windows\System32\lserver\TLSLic.edb to C:\Windows\System32\lserver\TLSLic.edb_old and start the service:

Then finally, run the command below to start up the service:

Start-Service TermServLicensing

I hope you found this blog post helpful on how to Remove and Manage RDS Licenses. If you have any questions, please let me know in the comment session.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Web Server, Windows, Windows Server Tags:rds, RDS CALs, Remote Desktop Connection, Remote Desktop Services, Windows Server 2016

Post navigation

Previous Post: Create and find Organisation Unit paths in AD
Next Post: Azure CLI: How To Upload Batch Files to Azure Storage Account

Related Posts

  • Windows Productivity Tips
    Windows Productivity Tips To Get The Most Out Of Your PC Windows
  • How to configure Volume Shadow Copies VSS on Windows Server
    Volume Shadow Copies: How to configure VSS on Windows Server Windows
  • Authentication Failed
    Authentication Failed: How to fix critical error could not connect to WordPress SFTP Server Mac
  • HyperV VM disk size increase
    How to Increase Disk Size in Hyper-V Virtualization
  • Screenshot 2022 04 02 at 23.05.24
    How to apply Windows Updates with PowerShell Windows
  • PIN9 1
    How to increase Windows PIN complexity Windows

More Related Articles

Windows Productivity Tips Windows Productivity Tips To Get The Most Out Of Your PC Windows
How to configure Volume Shadow Copies VSS on Windows Server Volume Shadow Copies: How to configure VSS on Windows Server Windows
Authentication Failed Authentication Failed: How to fix critical error could not connect to WordPress SFTP Server Mac
HyperV VM disk size increase How to Increase Disk Size in Hyper-V Virtualization
Screenshot 2022 04 02 at 23.05.24 How to apply Windows Updates with PowerShell Windows
PIN9 1 How to increase Windows PIN complexity Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

Veeam Vanguard

  • Clone SysPrep
    Clone and Sysprep a Windows Server running on a VMware Workstation Virtualization
  • LINUX CONTAINERS
    How to install LXC/LXD for container management Linux
  • Cannot save to the location Windows
    How to Fix Cannot Save to Windows System32 Default.rdp Error Network | Monitoring
  • Commvault Docker Images
    Pull and Push Commvault Images to Azure Container Registry AWS/Azure/OpenShift
  • Screenshot 2020 05 14 at 19.08.33
    Backup image to TFTP server Network | Monitoring
  • deactivateandreactivate
    How to deactivate and reactivate a Slack user JIRA|Confluence|Apps
  • Compacting VHD
    How to Compact Virtual Hard Disks on VMware Virtualization
  • vtpm 1
    Enable vTPM and BitLocker HyperV VM: Fix the device that cannot use a TPM module Virtualization

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,814 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.