Skip to main content
Windows Server

Licensing Mode for Remote Desktop Session Host is not Configured

By January 11, 2021January 23rd, 2021No Comments

When trying to configure a new RDSH node in the RDS farm running Windows Server 2012 R2/2016/2019, you may be encountered with the following warning popup message in the system tray – Licensing mode for the Remote Desktop Session Host is not configured.

Remote Desktop Service will stop working in 104 days.

On the RD Connection Broker server, use Server Manager to specify the Remote Desktop licensing mode and the license server.

WinServer 2012 R2 - Licensing mode for the RDSH is not configured

Judging by the error message, the RDS host is running in the grace period (during the grace period of 120 days, you can use the Remote Desktop Session Host without activating RDS licenses). When the grace period ends, users won’t be able to connect to RDSH, and an error will appear in the tray:

Remote Desktop Services will stop working because this computer is past grace period and has not contacted at least a valid Windows Server 2012 license server. Click this message to open RD Session Host Server Configuration to use Licensing Diagnosis.

I have already described a similar problem in the post about the RDS error “The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license”, but the situation is a bit different here.

For more accurate diagnostic of the problem, you need to run the RD Licensing Diagnoser tool— lsdiag.msc (Administrative Tools -> Remote Desktop Services ->RD Licensing Diagnoser). Its window shows the following error:

Licenses are not available for the Remote Desktop Session Host server, and RD Licensing Diagnoser has identified licensing problem for the RD Session Host server.
Licensing mode for the Remote Desktop Session Host is not configured.
The Remote Desktop Session Host server is within its grace period, but the Session Host server has not been configured with any license server.

As you can see, there are no licenses available to clients, since the licensing mode is not set.

RD Licensing Diagnoser - Licensing mode for the Remote Desktop Session Host is not configured

It means that the administrator did not specify the RDS Licensing Server and/or the licensing mode. It should be done even if the licensing type has already been specified when deploying the RDS host (Configure the deployment -> RD Licensing -> Select the Remote Desktop licensing mode).

set rd licensing mode during deployment

You can check whether the RDS license server is set using the following PowerShell commands:

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


Note. The Get-RDLicenseConfiguration cmdlet may return different, erroneous data.

If the RDS icense server is not set, you can specify it with the command:

$obj.SetSpecifiedLicenseServerList("") If you don’t remember which server the RD License role is installed on, you can display a list of all RDS Licensing servers registered in the Active Directory domain using the Get-ADObject cmdlet from the PowerShell ActiveDirectory module:

Get-ADObject -Filter {objectClass -eq 'serviceConnectionPoint' -and Name -eq 'TermServLicensing'}

There are several methods to force set the RDS licensing mode.

Using the registry:

In the registry key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core change the value of the DWORD parameter with the name LicensingMode from 5 to:

  • 2 – if Per Device RDS licensing mode is used;
  • 4 – if Per User licensing is used.
rds licensing mode - LicensingMode registry parameter

You can change the registry setting manually through regedit.exe or the following PowerShell commands from the registry management module:

# Specify the RDS licensing type: 2 - Per Device CAL, 4 - Per User CAL
$RDSCALMode = 2
# RDS Licensing host name
$RDSlicServer = ""
# Set the server name and type of licensing in the registry
New-Item "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers"
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" -Name SpecifiedLicenseServers -Value $RDSlicServer -PropertyType "MultiString"
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\" -Name "LicensingMode" -Value $RDSCALMode

After you have made the changes, restart your RDSH server.

You can also configure the RDS license server parameters using GPO (a local or a domain policy). If your RDS server is in a workgroup (not joined to the Active Directory domain), use the local Group Policy Editor gpedit.msc. Go to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing.

We need two policies:

  • Use the specified Remote Desktop license servers – enable the policy and specify the RDS license server address. If the license server is running on the same server, type - Use the specified Remote Desktop license servers
  • Set the Remote Desktop licensing mode – select the licensing mode. In our case, it is Per UserPOlicy - Set the Remote Desktop licensing mode - Per User

After restarting your server, open the RD Licensing Diagnoser and check the number of available RDS licenses and the licensing mode you have selected. If a firewall is used on your network, you must open the following ports from the RDSH host to the RDS licensing server – TCP:135, UDP:137, UDP:138, TCP:139, TCP:445, TCP:49152–65535 (RPC range).

You can check for open ports using the Test-NetConnection cmdlet. If the ports are closed on the local Windows Defender Firewall, you can open the ports using the PowerShell cmdlets from the NetSecurity module.

RD Licensing Diagnoser didn't identify any licensing problems

Also note that if, for example, Windows Server 2012 R2 and CAL for RDS 2012 R2 are installed on the RD Licensing Server, you won’t be able to install RDS CAL licenses for Windows Server 2016/2019. The “Remote Desktop Licensing mode is not configured” error persists even if you specify the correct license type and RDS license server name. Old Windows Server version simply do not support RDS CALs for newer versions.

In this case the following message will be displayed in the RD License Diagnoser window:

The Remote Desktop Session Host is in Per User licensing mode and no Redirector Mode, but license server does not have any installed license with the following attributes:
Product version: Windows Server 2016
Use RD Licensing Manager to install the appropriate licenses on the license server.
The Remote Desktop Session Host is in Per User licensing mode and no Redirector Mode, but license server does not have any installed appropriate license with the

First you will have to upgrade the Windows Server version on the RDS license server (or to deploy a new RD License host). A newer version of Windows Server (for example, WS 2019) supports RDS CAL for all previous versions of Windows Server.

Note. If your RDS server is in a workgroup, the licensing report is not generated. Although the terminal RDS licenses themselves are issued to clients/devices correctly. You will have to monitor the number of remaining RDS CALs yourself.

Leave a Reply