Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 Windows OS Hub / Windows Server 2016 / How to Install and Activate the RDS Licensing Role on Windows Server 2019/2016?

September 12, 2019 Windows Server 2016Windows Server 2019

How to Install and Activate the RDS Licensing Role on Windows Server 2019/2016?

In this article, we’ll consider the installation, configuration, and activation of Remote Desktop Licensing role on Windows Server 2019/2016, as well as the installation and activation of the RDS client access licenses (CALs).

I remind that after the installation of Remote Desktop Session Host role, users can use it only for 120 days of a trial period, and users can’t connect to an RDS host afterward. According to Microsoft licensing scheme, all users or devices that used RDS features must be licensed. To register and issue remote desktop client access licenses (RDS CALs), there is a separate service in RDS role called Remote Desktop License Server.

Contents:
  • Installing the Remote Desktop Licensing Role on Windows Server 2019/2016
  • Activating the RDS License Server on Windows Server
  • RDS CALs: Types of Remote Desktop Client Access Licenses
  • Installing RDS CALs on Windows Server 2016/2019
  • How to Remove RDS CALs from a RD License Server?
  • Specify a License Server Address on an RD Session Hosts

Installing the Remote Desktop Licensing Role on Windows Server 2019/2016

You can deploy the Remote Desktop License service on any domain server; it is not necessary to install it on one of the servers onthe RDSH farm.

Before you start the installation, add a new server to the Terminal Server License Servers domain group (or make sure you have the permission to change this group membership), otherwise the server won’t be able to issue RDS Per User CAL to the domain users.

You can install Remote Desktop Licensing using Server Manager. To do it, select Remote Desktop Services role in the Add Roles and Features Wizard.

install Remote Desktop Services role

Select Remote Desktop Licensing as the role service.

Remote Desktop Services Licensing service

Wait untill the role is installed.
RDS licensing feature installation

Additionally, install the utility for diagnosing licensing problems on RDS servers —  Remote Desktop Licensing Diagnoser (lsdiag.msc), which can be set using Server Manager: Features -> Remote Server Administration Tools -> Role Administration Tools -> Remote Desktop Services Tools -> Remote Desktop Licensing Diagnoser Tools (by default, when installing the RDS-Licensing service, only the Remote Desktop Licensing Manager console [licmgr.exe] is installed).

install Remote Desktop Licensing Diagnoser Tool

You can also install the RDS Licensing service and lsdiag.msc tool using PowerShell:

Install-WindowsFeature RDS-Licensing –IncludeAllSubFeature -IncludeManagementTools

Activating the RDS License Server on Windows Server

In order to issue licenses to RDP clients, your RDS License Server must be activated. To do it, open the Remote Desktop Licensing Manager, right-click the name of your server and select Activate Server. activa rds licensing server

The RDS licensing server activation wizard will start. Here you will need to select the activation method you prefer. If your server is connected to the Internet, it can automatically connect to Microsoft servers and activate RDS license server. If there is no direct Internet access from the server, you can activate the server using a web browser or by phone.

RDS license server automatic activation

Then you must enter some information about your company (some fields are mandatory). rds license company info

It remains to click the Finish button.

rds license server has been successfully activated
If you right-click the server name in the console and select Review Configuration, you can verify that the RDS License Server is activated and can be used to activate RDSH clients in your domain.
review rds activation info

RDS CALs: Types of Remote Desktop Client Access Licenses

Each user or device that connects to Remote Desktop Session hosts must have a client access license (CAL). There are two types of RDS CALs:

  • Per Device CAL – is the permanent license type assigned to a computer or a device that connects to the RDS server more than once (when a device is first connected, a temporary license is issued to it). These licenses are not concurrent, i.e., if you have 10 Per Device licenses, only 10 hosts can connect to your RDS server;
  • Per User CAL – is the type of license that allows a user to connect to the RDS server from any number of computers/devices. This type of license is associated with an Active Directory user and issued not permanently, but for a specific period of time (90 days, by default).
    If you try to use RDS 2019 Per User CAL in a workgroup (not in a domain), then the RDSH server will forcibly ending a user session every 60 minutes with a message: “Remote Desktop License Issue: There is a problem with your Remote Desktop license, and your session will be disconnected in 60 minutes”. Therefore, for RDS servers in a Windows Workgroup environment, you need to use only device licensing – Per Device RDS CALs.Remote Desktop License Issue:There is a problem with your Remote Desktop license, and your session will be disconnected in 60 minutes 
Note. We should note that 2016 RDS CAL may be installed only on a licensing server running Windows Server 2016, the installation of new CALs to the previous Windows Server versions is not supported. Those, you cannot install 2016 RDS CALs on a Windows Server 2012 R2 licensing host.

Installing RDS CALs on Windows Server 2016/2019

Now you must install the package of remote desktop client licenses (RDS CAL) you have purchased on the License Server.

Right-click your server in Remote Desktop Licensing Manager and select Install Licenses.

installing rds CAL

Select the activation method (automatic, online or by phone) and the license program (in our case, it is Enterprise Agreement).
rds cal - enterprise agreement

The next steps of the wizard depend on which license program you have selected. In case of Enterprise Agreement, you must specify its number. If you have chosen License Pack (Retail Purchase), enter the 25-character product key you got from Microsoft.
rds cal - agreement number

Specify the product version (Windows Server 2019/2016), license type (RDS Per user CAL) and the number of licenses to be installed on the server.

select license type and number of RDS CALs

After that, the server can issue licenses (RDS CAL) to clients.

You can convert User CAL RDS to Device CAL (and vice versa) using the Convert Licenses menu item in the RD Licensing Manager console.

Convert RDS CALs

If you have run out of free RDS licenses, you can revoke previously issued RDS Device CALs for inactive computers using the following PowerShell script:

$RevokedPCName=”lon-bc1-123”
$licensepacks = Get-WmiObject win32_tslicensekeypack | where {($_.keypacktype -ne 0) -and ($_.keypacktype -ne 4) -and ($_.keypacktype -ne 6)}
$licensepacks.TotalLicenses
$TSLicensesAssigned = gwmi win32_tsissuedlicense | where {$_.licensestatus -eq 2}
$RevokePC = $TSLicensesAssigned | ? sIssuedToComputer -EQ $RevokedPCName
$RevokePC.Revoke()

How to Remove RDS CALs from a RD License Server?

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

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

Get-WmiObject Win32_TSLicenseKeyPack|select-object KeyPackId,ProductVersion,TypeAndModel,AvailableLicenses,IssuedLicenses |ft

Win32_TSLicenseKeyPack get RDS CAL packs installed

Find the KeyPackId value for the RDS CAL package that you want to remove and run the command:

wmic /namespace:\\root\CIMV2 PATH Win32_TSLicenseKeyPack CALL UninstallLicenseKeyPackWithId yourKeyPackId

You can also completely remove all CALs by re-creating the RDS license database. To do this, stop the Remote Desktop Licensing service:

Stop-Service TermServLicensing

Rename the file C:\Windows\System32\lserver\TLSLic.edb to C:\Windows\System32\lserver\TLSLic.edb_bak and start the service:

Start-Service TermServLicensing

After that, all RDS CAL licenses will be deleted, and you must reactivate them.

Specify a License Server Address on an RD Session Hosts

After the RDS License Server is activated and being run, you can reconfigure RD Session Host to obtain CAL licenses from this server. You can set the license type and specify the name of the license server from the Server Manager GUI, using PowerShell or GPO.

To change the name/address of the licensing server on the RDS host, open Server Manager -> Remote Desktop Services -> Collections. In the upper right menu “Tasks” select “Edit Deployment Properties”.

rds Edit Deployment Properties

In the deployment properties, go to the RD Licensing tab, select the Remote Desktop licensing mode and the RDS license server. Click Add -> Ok.

set rd license server via server manager

If the licensing type is not set on the RDSH server, you will receive the error “Licensing mode for the Remote Desktop Session Host is not configured”.

You can change the RDS license server address and CAL type using PowerShell:

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting

Then specify the license type you need:

$obj.ChangeMode(4)

Note. Enter 4 if the server must use Per User licensing type, and 2, if it is Per Device.

Then specify the name of the RDS License Server:

$obj.SetSpecifiedLicenseServerList("rdslic2016.woshub.com")

And check the current settings:

$obj.GetSpecifiedLicenseServerList()

When configuring RDS licensing parameters for RD session hosts via GPO, you need to create a new GPO and link it to the OU with RDS servers (or you can specify the name of the RDS licensing server using the local Group Policy editor – gpedit.msc). The RD licensing settings are located in the following GPO section: Computer Configuration -> Policies -> Admin Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing

There are 2 RD policies that we need to configure:

  • Use the specified Remote Desktop license servers – the address of the License Server is set;
  • Set the Remote Desktop licensing mode – select RDS CAL license type.

gpo - Use the specified Remote Desktop license servers

RDSH hosts use the following ports to get RDS license from the Licensing server, make sure that they are not blocked by firewalls (or Windows Defender Firewall):

  • TCP/135 – Microsoft RPC;
  • UDP/137 – NetBIOS Datagram Service;
  • UDP/138 – NetBIOS Name Resolutio;
  • TCP/139 – NetBIOS Session Service;
  • TCP/445 – SMB;
  • TCP/49152–65535 – RPC dynamic address range

You can check for open ports using the PortQry utility or the Test-NetConnection cmdlet.

Try to check the License Server status and the number of the issued licenses using RD Licensing Diagnoser (Administrative Tools -> Remote Desktop Services -> RD Licensing Diagnoser).

If there are no warnings, and you see the message “RD Licensing Diagnoser did not identify any licensing problems for the Remote Desktop Session Host server”, then the RDSH server can successfully receive RDS CALs for remote users/devices.

RD Licensing Diagnoser did not identify any licensing problems for the Remote Desktop Session Host server

Note. In our case, after we specified the new License Server address the following error started to appear on the RDP client: “The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license”. The problem can be solved by removing the L$RTMTIMEBOMB key from the registry.

11 comments
2
Facebook Twitter Google + Pinterest
previous post
Managing Microsoft Office Settings with GPO Administrative Templates
next post
0x80092004: .NET Framework Install Error on Windows Server

Related Reading

Preparing Windows for Adobe Flash End of Life...

January 22, 2021

How to Disable/Remove Thumbs.db File on Network Folders...

January 21, 2021

MS SQL Server 2019 Installation Guide: Basic Settings...

January 19, 2021

USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

January 15, 2021

How to Enable and Configure User Disk Quotas...

December 23, 2020

11 comments

dart January 19, 2019 - 7:11 am

RD Licensing Diagnoser won’t appear until you install the Remote Desktop Session host role.

Reply
vipul February 11, 2019 - 8:09 am

is it necessary to install ADDS to activate CAL in Windows server 2016 Standard?

Reply
Lotfi Lakhal March 28, 2019 - 8:45 am

I got an internal inquiry, though I am not convinced why they want to know the details (which server). We have a cluster of dual (active/backup) servers, where the authentication licensing is configured on the main then backup servers (WS2016). A group of users(say 10) initiated sessions via remote desktop to the cluster, but none of the servers is showing any licensing authentication (No of licenses is shown as 0 on the dashboard). But sessions/connections are up. The question is how to determine which server is providing which authentication licensing number to which user, and how to visualize that (not sure if authentication license manager can do that)? Initially 50 licenses x 4 groups (i.e. total 200 licenses) were configured on the main then backup servers. It might be confusing and difficult to understand the situation. I hope a professional administrator can advise me and appreciate your early feedback. Thanks.

Reply
admin April 3, 2019 - 6:15 am

I don’t understand your architecture … If you have 2 RDSH servers, it would be correct to combine them into one RDS farm. You can use any of these servers or third server (for example, with the RD Connection Broker role) an RDS license server.

Reply
DNirodha June 8, 2020 - 5:25 pm

Thank you Sooo much… This is great work. Knowledge sharing is very very valuable……

Reply
basheer June 25, 2020 - 2:49 am

if you configured as “per user” no way to track, if you configured as per device you can find out which server connected and licenses assigned numbers etc.

Reply
Amit September 4, 2020 - 12:42 pm

great article. Really helpful

Reply
Shlomi October 1, 2020 - 8:16 am

Many thanks! Helped me Install the license correctly.

Reply
Paul October 9, 2020 - 2:01 pm

Hi, i have a Windows 2016 Server VM hosted on VMware, The 120 day grace period expired so i bought 5 CAL licences as a number of users need to log on to this VM. I followed the above steps. I activated the Licence Server on the VM then proceeded to add the CAL licences on the same server. Every thing looked good on Licence Manager with Licence Server Activated and 5 available CAL User licences. However when i try to remote onto the VM it says “No Remote Licence Servers available to provide a licence”. Also in RD Diagnoser states no licences available / The licensing mode for the remote desktop Host Server is not configured / The Remote Desktop Session Host server is not configured with any licence server. Have I missed something obvious?

Reply
admin October 10, 2020 - 8:43 am

Check this post http://woshub.com/licensing-mode-rds-host-not-configured/

Reply
Rihan December 8, 2020 - 10:05 am

Hi,
I used RDS 2019 Per User CAL in a workgroup (not in a domain), and now I have error message ” remote desktop issue”.
Also, I installed license.
Could you please help me?
Should I install ADDS role?

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • Preparing Windows for Adobe Flash End of Life on December 31, 2020

    January 22, 2021
  • Checking User Logon History in Active Directory Domain with PowerShell

    January 22, 2021
  • How to Disable/Remove Thumbs.db File on Network Folders in Windows?

    January 21, 2021
  • MS SQL Server 2019 Installation Guide: Basic Settings and Recommendations

    January 19, 2021
  • USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

    January 15, 2021
  • Windows 10: No Internet Connection After Connecting to VPN Server

    January 13, 2021
  • Updating the PowerShell Version on Windows

    December 24, 2020
  • How to Enable and Configure User Disk Quotas in Windows?

    December 23, 2020
  • Restoring Deleted Active Directory Objects/Users

    December 21, 2020
  • Fix: Search Feature in Outlook is Not Working

    December 18, 2020

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Repair EFI/GPT Bootloader on Windows 10?
  • How to Run Program without Admin Privileges and to Bypass UAC Prompt?
  • Licensing Mode for Remote Desktop Session Host is not Configured
  • Configuring Port Forwarding on Windows
  • Updating List of Trusted Root Certificates in Windows 10/8.1/7
  • Allow RDP Access to Domain Controller for Non-admin Users
  • How to Upgrade Windows Server 2019/2016 Evaluation to Full Version?
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top