When trying to configure a new RDSH node in the RDS farm running Windows Server 2012 R2/2016/2019, you may encountered with the following warning popup message in the system tray:
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.
Judging by 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.
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.
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).
You can check whether the RDS license server is set using the following PowerShell commands:
$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.GetSpecifiedLicenseServerList()
If the RDS icense server is not set, you can specify it with the command:
$obj.SetSpecifiedLicenseServerList("uk-rdslic1.woshub.com")
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.
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 = "uk-rdslic1.woshub.com"
# 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
127.0.0.1
; - Set the Remote Desktop licensing mode – select the licensing mode. In our case, it is 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.
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.
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.
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.
30 comments
Thank you for saving my day, I tested on Windows 2016 server and worked perfectly.
Thank you from Russia!!!
Very helpful, it’s silly how complicated Microsoft makes some stuff
What a lifesaver this page was. So simple!
Fantastic, Thank you, with your explanation, it was possible to license our server.
awesome..thank you
Funciono perfecto, en verdad me ayudo a quitarme un dolor de cabeza
This is confirmed the same on Server 2019 as well.
thanks this worked for me on server 2019 aswell absolute life saver
Thank you from Colombia. This works in windows 2016. Me salvaste la patria.
Thank You from Australia.
This configuration has to be just done on the DC which is the host Server or on all the Server Desktops where this License is applied ?
Thank you!! I’ve been pulling my hair out on this one! Using the GPO worked like a champ.
Thank you very much, helped me a lot.
i have a problem like this… my rdp don’t block more users, i have a license for three users, but i connect more than three and go normally, and i don’t find the problem..
Check how many RDS CALs are available on your RD License servere. You can also use the RD Licensing Diagnoser.
GREAT!! Now this article made it!! I spent days but my installed licenses were not registered.The Power Shell commands was the kick!
THANK YOU VERY MUCH!!
Thank you from Ukraine. It working for me!
This was great. Thanks. Used the GPO method for a 2019 workgroup server.
Thanks for your solution!
Thank you, it helped.
You are close to GOD….(whichever one you may believe in!)…. Thx.
Hang on…..problem not solved even though RD Licensing Diagnoser shows all is well!
Now I get
“Remote Desktop Issue
There is a problem with your Remote Desktop licence, and your session will be disconnected in 60 minutes. Contact your system administrator to fix the problem.” when I log in as a user!!!
I guess you have configured RDS CAL per user and you have workgroup (not AD) – you need to configure RDS to use licences per Device and you can convert RDS CAL if you already bought “RDS CAL per User” – there is such option in Licensing Manager
Thanks, this worked for me on Server 2019
Thanks mucho, your article has guided me into directly way to solve my problem.
Many thanks, this helps to solve my problem on Server 2019
Thx, worked perfectly for server 2019!
The GPO fix did the trick! Thank you so much!!!
I purchased and installed a pack of 5 per user CALs for Server 2019 RDS while still in the “grace period” but there is no evidence of the 5 licenses in the RD licensing manager. The manager reports 50 CALs and 14 issued with expirations in late February and early March, 2021. I tried reinstalling the 5 pack in case I missed something in the original activation but the MS licensing server reported the 5 pack had already been installed. I’m concerned when the grace period licenses expire we’ll be locked out of the RDP server even though there are currently 5 valid per user CALs licenses. I plan to purchase an additional 10 per user CALs prior to the grace period expiration. The license diagnoser shows no problems, all check marks are green. Are we OK after the grace period expires?