The error “Licensing Mode for Remote Desktop Session Host is not Configured” often triggers triggers when the RDS host is running in grace period.
As a part of our Server Management Services, we help our Customers to fix Windows related errors regularly.
Let us today discuss the possible causes and fixes for this error.
What causes the error “Licensing Mode for Remote Desktop Session Host is not Configured” ?
While trying to configure a new RDSH node in the RDS Windows Server we may face a warning popup message as shown below:
From the error message, 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).
When the grace period ends, users will not be able to connect to the host, 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.
How to fix the error “Licensing Mode for Remote Desktop Session Host is not Configured” ?
We can have an accurate diagnostic of the problem with the RD Licensing Diagnoser tool— lsdiag.msc.
This is accessible from Administrative Tools -> Remote Desktop Services -> RD Licensing Diagnoser. Most probably, it will 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.
It means that the administrator do not specify the RDS Licensing Server and/or the licensing mode.
It should be done even after specifying the licensing type while deploying the RDS host.
We 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 license server is not set, we can specify it with the command:
$obj.SetSpecifiedLicenseServerList("uk-rdslic1.woshub.com")
If we do not remember which server with the RD License role installed on, we 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'}
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 it uses Per Device RDS licensing mode
- 4 – if it uses Per User licensing
We 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 we have made the changes, we can restart the RDSH server.
We can also configure the RDS license server parameters using GPO (a local or a domain policy). If the RDS server is in a workgroup, 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. 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 uses a firewall on the network, we 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).
We can 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.
[Need any further assistance in fixing licensing mode for the remote desktop session host? – We’re available 24*7]
Conclusion
In short, the error “Licensing Mode for Remote Desktop Session Host is not Configured” often triggers triggers when the RDS host is running in grace period.Today, we saw how our Support Engineers fix this error.
0 Comments