Are you finding a solution to the error message ‘remote session disconnected because there are no remote desktop license servers’? We can help you fix it.
Here at Bobcares, we have seen several such Windows-related errors as part of our Server Management Services for web hosts and online service providers.
Today we’ll take a look at the causes for this error and see the fix.
What causes the error ‘remote session disconnected because there are no remote desktop license servers’ to occur
This licensing error when connecting RDP clients to an RDS host may appear if:
- On the Remote Desktop Services settings, the RDS licensing server from which we want to get client licenses (RDS CALs) is not specified.
- The RDS licensing server has run out of available CALs
- The RDP client tries to connect with an expired temporary RDS license
How we resolve this error
Now let’s take a look at the different common issues related to RDS licensing when RDP clients cannot connect to Windows Server with the Remote Desktop Services Host role installed. Also, let us see how our Support Engineers resolve this error for our customers.
1. Remote session was disconnected because there are no Remote Desktop client access licenses available for this computer
Recently, one of our customers was getting RDS CALs from the license server. Here is a screenshot of the error message.
First, we connect to the RDSH server in administrative mode (mstsc.exe /admin) and run the RD Licensing Diagnoser tools. Here, we see the name of the RDS licensing server, and the type of license (Per User/Per Device).
Next, we connect to the RDS license server using the RD Licensing Manager console (licmgr.exe). Then we check if we have available free licenses of the required type (Per User or Per Device). In case, if we run out of free RDS CALs, we may need to purchase a new CAL pack, we wait for someone to release the license, or revoke unused licenses directly from the console (right-click on the computer/user and select Revoke License).
In this case, the client computer is trying to connect to the RDSH server with an expired temporary RDP license (if the RDS license server was unavailable when the client first connected, the client was issued a temporary RDP license for 180 days). So, we need to reset this license in the registry on the client device.
We follow the below steps:
- First, we start the Registry Editor (regedit.exe);
- Next, we remove the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing;
- Then we close the registry editor and run the mstsc.exe (Remote Desktop Connection) as an administrator;
- Finally, we connect to the RDS server. In this case, the MSLicensing reg key will be automatically re-created, and the computer will receive a new RDP license.
2. The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license
One of our customers has encountered a problem with the deployed farm of RDS servers on Windows Server 2012 R2. The RDS server had stopped issuing terminal licenses to users. However, the installation and configuration of the license server role were made, and RDP CALs had been activated.
When a user tries to connect to the terminal server via RDP, the following error appears:
In order to resolve this, we first, connect to the server console in administrative mode (mstsc /admin).
Next, we open the Server Manager, and go to the RDS settings (Remote Desktop Services >> Deployment Overview >> Tasks >> Edit Deployment Properties).
Also, we make sure that the correct Remote Desktop license server and RDS CAL type (Per Device or Per User) are specified in the RDSH configuration.
We can also check the RDS licensing server settings via PowerShell:
Get-RDLicenseConfiguration
Then we check if the below ports are not blocked by firewalls when accessing from the RDSH host to RDS LicenseingServer:
TCP 135, UDP 137, UDP 138, TCP 139, TCP 445, TCP 49152–65535 (RPC range).
If the RDS License server is not available, the License Diagnoser will display an error:
License server rdslic_hostname is not available. This could be caused by network connectivity problems, the Remote Desktop Licensing service is stopped on the license server, or RD Licensing isn't available.
Reset 120 Days RDS Grace Period (L$RTMTIMEBOMB)
In the Event Viewer on the RDS host, we can see an error like this:
EventID: 1128 Source: TerminalServices-RemoteConnectionManagerThe RD Licensing grace period has expired and the service has not registered with a license server with installed licenses. A RD Licensing server is required for continuous operation. A Remote Desktop Session Host server can operate without a license server for 120 days after initial start up.
The RD License Diagnoser will most likely also display an error:
The grace period for the Remote Desktop Session Host server has expired, but the RD Session Host server hasn't been configured with any license servers. Connections to the RD Session Host server will be denied unless a license server is configured for the RD Session Host server.
It means that the grace period for the RDSH server has expired. So we need to extend the grace mode or activate the host on an RDS license server.
We can find the number of days before the end of the RDS Grace Period from the elevated command prompt:
wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !="") CALL GetGracePeriodDays
In order to extend the grace period in RDS, we need to remove the registry parameter on the server. It determines the grace period licensing time. The date that determines the RDS grace period for the server is present in the reg_binary registry parameter L$RTMTIMEBOMB located in the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod
Now, we need to remove the RTMTIMEBOMB parameter from the registry. However, the administrator does not have enough permissions to do this.
Unable to delete all specified values.
To remove this registry parameter, we open the parent key permissions and grant the account the privileges of the key owner. Then we set the Full Control permissions for the Administrators group.
Next, we right-click L$RTMTIMEBOMB parameter and delete it.
After that, we restart the RDSH server and connect to it using the RDP client. Also, we make sure that the RDS CAL has been issued successfully using the Remote Desktop Licensing Manager.
Then using this PowerShell command, we make sure if the RDS licensing server is set:
$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.GetSpecifiedLicenseServerList()
If the RDS licensing server is not set (SpecifiedLSList is empty), we force to set the RD licensing server with the following command:
$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.SetSpecifiedLicenseServerList("lon-rdslic.bobcares.com")
The RDS host will now be able to obtain licenses from the RDS Licensing server and issue them to the RDP users.
[Need any further assistance in fixing Windows errors? – We are here to help you]
Conclusion
Today, we saw how our Support Engineers resolve this Windows error.
Deleting GracePeriod did magic for me.
Thanks alot