Remote Desktop users sometimes experience an error "Licensing Mode for Remote Desktop Session Host is not Configured" when the RDS host is running in grace period.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix Windows related errors.
In this context, we will look at what triggers this error and how to get rid of it.
Sometimes, in the process of configuring a new RDSH node in the RDS Windows Server, users might face a warning popup message as shown below;
Remote Desktop licensing mode is not configured.
Remote Desktop Services 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.
From analyzing the error message, you will see that the Remote Desktop Session(RDS) Host is running in the grace period (during the grace period of 120 days, we can use the Remote Desktop Session Host without activating RDS licenses).
As soon as the grace period ends, users will not be able to connect to the host. If you take a look at tray, you will see an error message such as this;
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.
By means of an RD Licensing Diagnoser tool "lsdiag.msc", this problem can be diagnosed.
To do this, go to the "Administrative Tools -> Remote Desktop Services -> RD Licensing Diagnoser".
You will see the an error message such as this;
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.
This signifies that the administrator do not specify the RDS Licensing Server and/or the licensing mode.
The right way to go is to it after specifying the licensing type while deploying the RDS host.
To check that the RDS license server is set, you can run the following commands via PowerShell;
obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
obj.GetSpecifiedLicenseServerList()
In a case where the RDS license server is not set, we can simply specify it by running the command as shown below;
obj.SetSpecifiedLicenseServerList("uk-rdslic1.woshub.com")
Sometimes, you might not remember server on which the RD License role is installed on. So to display a list of all RDS Licensing servers registered in the Active Directory domain, you need to run the Get-ADObject cmdlet from the PowerShell ActiveDirectory module as shown below;
Get-ADObject -Filter {objectClass -eq 'serviceConnectionPoint' -and Name -eq 'TermServLicensing'}
From the registry key "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing" Core you can change the value of the DWORD parameter with the name LicensingMode from 5 to;
2 – if it uses Per Device RDS licensing mode
4 – if it uses Per User licensing
Now you can change the registry setting manually through "regedit.exe" or from the registry management module, you can run the following PowerShell commands;
# 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 the changes is made, simply restart the RDSH server to effect changes.
You can also configure the RDS license server parameters using GPO (a local or a domain policy). If the RDS server is in a workgroup, it is best to use the local Group Policy Editor "gpedit.msc".
Navigate to "Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing".
To make this work, we need two policies:
i. Use the specified Remote Desktop license servers – enables the policy and specify the RDS license server address. If the license server is running on the same server, type 127.0.0.1
ii. You should set the Remote Desktop licensing mode by selecting the licensing mode. For example, Per User.
After restarting the server, open the "RD Licensing Diagnoser" and check the number of available RDS licenses and the licensing mode.
If it is behind a firewall on the network, then 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).
Now, check for open ports using the "Test-NetConnection" cmdlet.
We can open the closed ports on the local Windows Defender Firewall using the PowerShell cmdlets from the NetSecurity module.
This article will guide you on the error "Licensing Mode for Remote Desktop Session Host is not Configured" which occurs when the RDS host is running in grace period.