2. Determine the license server for Remote Desktop Services
Now let's run the Remote Desktop Licensing Diagnostic Tool (RD Licensing Diagnoser). You can do this from the Server Manager by selecting "Tools" (Tools) → "Terminal Services" → "RD Licensing Diagnoser" in the upper right menu:

Here we can see that there are no licenses available yet because the licensing mode for the RD Session Host server is not set:

The licensing server is now specified in local group policies. To launch the editor, run the gpedit.msc command:

The Local Group Policy Editor opens. In the tree on the left, expand the tabs:
- Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → (Remote Desktop Session Host) → "Licensing" (Licensing).
Open the "Use the specified Remote Desktop license servers" settings by double-clicking on the appropriate line:

In the policy settings editing window, move the switch to the Enabled position. Next, you must define a license server for Remote Desktop Services. In my example, the license server is located on the same physical server. Specify the network name or IP address of the license server and click "OK":

Next, change the policy settings "Set the Remote licensing mode". We also set the switch to the Enabled position and specify the licensing mode for the Remote Desktop Session Host server. There are 2 options:
To understand how these modes differ, consider a simple example. Let's say you have 5 licenses. In Per Device mode, you can create an unlimited number of users on the server who can only connect via Remote Desktop from up to five computers that have these licenses installed. If you select the "Per user" mode, then only five selected users will be able to access the server, regardless of which device they connect from.
Select the mode that best suits your needs, and click "OK":

After changing the above policies, close the editor:

We return to the RD Licensing Diagnoser snap-in and see a new error indicating that the license server is specified, but not enabled:

To start the licensing server, go to the "Remote Desktop Licensing Manager" (RD Licensing Manager). You can find it in Server Manager, Tools tab → Terminal Services → Remote Desktop Licensing Manager:

Here we find our license server with the status "Not activated" (Not Activated). To activate it, right-click on it and select "Activate Server" in the context menu:

The Server Activation Wizard will start. Click "Next" on the first page of the wizard:

Then select the connection method (“Auto” (Automatic connection) - by default) and click “Next” (Next):

Enter information about the organization (these fields are required) and then click "Next" (Next):

Enter additional information about the organization (optional) and click "Next" again:

The license server is activated. Now the licenses should be installed. To do this, click "Next" (Next), leaving a mark in the checkbox "Run the license installation wizard":
