Cannot connect to RDS because no RD Licensing servers are available

This article help you troubleshoot the "No licenses available" error in a deployment that includes an Remote Desktop Session Host (RDSH) server and a Remote Desktop Licensing server.

Applies to:   Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

Symptoms

Clients cannot connect to Remote Desktop Services, and they display messages that resemble the following:

The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license.
Access was denied because of a security error.

Sign in to the RD Session Host as a domain administrator and open the RD License Diagnoser. Look for messages like the following:

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.
License server <computer name> 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.

Cause

These issue could be caused by the following user messages:

  • The remote session was disconnected because there are no Remote Desktop client access licenses available for this computer.
  • The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license.

In this case, check the RD Licensing configuration.

If the RD License Diagnoser lists other problems, such as "The RDP protocol component X.224 detected an error in the protocol stream and has disconnected the client", there may be a problem that affects the license certificates. Such problems tend to be associated with user messages, such as the following:

Because of a security error, the client could not connect to the Terminal server. After making sure that you are signed in to the network, try connecting to the server again.

In this case, refresh the X509 Certificate registry keys.

Check the RD Licensing configuration

You can check the RD Licensing configuration by using Server Manager and RD Licensing Manager. Verify the following:

Configure licensing for an RDS deployment that includes the RD Connection Broker role

  1. On the RD Connection Broker computer, open Server Manager.

  2. In Server Manager, select Remote Desktop Services > Overview > Edit Deployment Properties > RD Licensing.

    Select the Edit Deployment Properties option to open the Remote Desktop licensing settings in Server Manager.

  3. Select the Remote Desktop licensing mode (either Per User or Per Device, as appropriate for your deployment).

    Note

    If you use domain-joined servers for your RDS deployment, you can use both Per User and Per Device CALs. If you use workgroup servers for your RDS deployment, you have to use Per Device CALs In that case, Per User CALs are not permitted.

  4. Specify a license server, and then select Add.

    Configure the deployment of the RD Licensing.

Configure licensing for an RDS deployment that includes only the RD Session Host role and the RD Licensing role

  1. On the RD Session Host computer, select Start, and then enter gpedit.msc to open Local Group Policy Editor.

  2. Go to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Licensing.

    List of policies for Remote Desktop licensing.

  3. In the policy list, right-click Use the specified Remote Desktop license servers, and then select Properties.

  4. Select Enabled, and then enter the name of the license server under License servers to use. If you have more than one license server, use commas to separate their names.

    Set the license servers to use in the Use the specified Remote Desktop license servers dialog box.

  5. Select OK.

  6. In the policy list, right-click Set the Remote Desktop licensing mode, and then select Properties.

  7. Select Enabled.

  8. Under Specify the licensing mode for the Remote Desktop Session Host server, select Per Device or Per User, as appropriate for your deployment.

    Specify the licensing mode for the Remote Desktop Session Host server in the Set the Remote Desktop licensing mode dialog box.

Refresh the X509 Certificate registry keys

Important

Follow this section's instructions carefully. Serious problems can occur if the registry is modified incorrectly. Before you starty modifying the registry, back up the registry so you can restore it in case something goes wrong.

To resolve this problem, back up and then remove the X509 Certificate registry keys, restart the computer, and then reactivate the RD Licensing server. Follow these steps.

Note

Perform the following procedure on each of the RDSH servers.

Here's how to reactivate the RD Licensing server:

  1. Open the Registry Editory and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM.
  2. On the Registry menu, select Export Registry File.
  3. Enter exported- Certificate into the File name box, then select Save.
  4. Right-click each of the following values, select Delete, and then select Yes to verify the deletion:
    • Certificate
    • X509 Certificate
    • X509 Certificate ID
    • X509 Certificate2

Additional troubleshooting methods

If you verify that the licensing configuration is correct, but the system still isn't correctly issuing CALs, follow these steps:

  1. Use RD Licensing Diagnoser to check for issues
  2. Make sure that the versions of your RDS CALs, RD Session Hosts, and RD License Servers are compatible
  3. Make sure that you're using the appropriate type of RDS CAL for your RDS environment

Step 1: Use RD Licensing Diagnoser to check for issues

To open RD Licensing Diagnoser, open Server Manager, and select Tools > Terminal Services > RD Licensing Diagnoser.

Screenshot of the RD Licensing Diagnoser dialog box.

The top window of the RD Licensing Diagnoser lists problems that the diagnoser has detected. For example, you might see a message that resembles the following:

Licenses are not available for this Remote Desktop Session Host server, and RD Licensing Diagnoser has identified licensing problems for the RD Session Host Server

The RD Licensing Diagnoser Information section shows more information about the problem, including its possible causes and the steps to follow to remediate it.

Step 2: Make sure that the versions of your RDS CALs, RD Session Hosts, and RD License Servers are compatible

The following table shows which RDS CAL and RD Session Host versions are compatible with one another.

RDS 2008 R2 and earlier CAL RDS 2012 CAL RDS 2016 CAL RDS 2019 CAL
2008, 2008 R2 session host Yes Yes Yes Yes
2012 session host No Yes Yes Yes
2012 R2 session host No Yes Yes Yes
2016 session host No No Yes Yes
2019 session host No No No Yes

The following table shows which RDS CAL and license server versions are compatible with one another.

RDS 2008 R2 and earlier CAL RDS 2012 CAL RDS 2016 CAL RDS 2019 CAL
2008, 2008 R2 license server Yes No No No
2012 license server Yes Yes No No
2012 R2 license server Yes Yes No No
2016 license server Yes Yes Yes No
2019 license server Yes Yes Yes Yes

For more information, see RDS CAL version compatibility.

Step 3: Make sure that you're using the appropriate type of RDS CAL for your RDS environment

If you use domain-joined servers for your RDS deployment, you can use both Per User and Per Device CALs. If you use workgroup servers for your RDS deployment, you have to use Per Device CALs In that case, Per User CALs aren't permitted.