Sometimes IT guys forget configuring the remote desktop session host server when they install the RDS role on their windows server. If you look at the RD Licensing Diagnoser tool you can the error on the section of Problem, and “The licensing mode for the Remote Desktop Session Host Server is not configured.” in the Suggested Resolition section “Set the licensing mode on the Remote Desktop Session Host server to either Per User or Per Device. Use RD Licensing Manager to install the corresponding licenses on the license server.” it says.
You can see an example below.

To fix this problem you should follow the given lines below.
1) Type in the following command:
a. gpedit.msc
Navigate to:
Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Licensing
2) Select the policy: “Set the Remote Desktop licensing mode”. Click Edit.

3) Select the policy “Use the specified Remote Desktop license servers”
4) Select “Enabled”, then input the name of the server you installed the licenses. Click Apply.

5) Navigate to:
Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections
6) Edit the policy “Limit number of connections”.
7) Select “Enabled” and change the number to “999999”. This will allow unlimited remote connections. In our case i just need 20 connections. Click Apply.

8) In order to apply changes, the group policy must be updated. To initiate this, open Command Prompt (as admin) and enter the following command:
gpupdate /force
After following the above steps, users will be able to remote into the specified server.
Regards,
Have a nice day.
Perfect :)
Thank’s a lot!
Awesome, thanks a lot!