Licenses are not available for this Remote Desktop Session
With the installation of the new license server in our environment I have installed RDP licenses using RD Licensing manager. Strangely, some users started receiving licenses in their server sessions, while others were reporting errors that the license server has not been configured.
Once I have opened RD Licensing Diagnoser I could see the following error messages:
Licenses are not available for the Remote Desktop Session Host server, and RD Licensing Diagnoser had identified licensing problems for the RD Session Host server.
Number of licenses available for clients: 0
RD Licensing Diagnoser Information – 2 warnings
The licensing model for the Remote Desktop Session Host server is not configured.
The Remote Desktop Session Host server is within its grace period, but the RD Session Host server has not been configured with any license server.
Although I have set GPO to specify the Remote Desktop Session Host server and the licensing mode for the Remote Desktop Session Host server I had to manually do these changes on the license server itself using PowerShell.
Open Powershell in elevated mode (run as admin)
type the following command and hit enter:
$obj = gwmi -namespace “Root/CIMV2/TerminalServices” Win32_TerminalServiceSetting
after this run the following command:
$obj.ChangeMode(4)
This commands will specify the licensing mode. $obj.ChangeMode(4) sets the licensing mode to “per user” mode.
After this, we have to specify the license server with the command below. Please use the fully qualified domain name of the license server.
$obj.SetSpecifiedLicenseServerList(“%FQDN license servername%”
Once done, refresh or restart the RD Licensing Diagnoser console and the Licenses are not available for this Remote Desktop Session Host server error messages should be cleared now.
That’s it. Please note that I have removed the domain name, license server name and the real number of licenses for security purposes.
Update: This solution can be applied to Windows Server 2019 too. Thanks for the update Ben!
Comments are welcome!
Thanks! That solved my problem!
Thanks. Solved my problem too. (Server 2019)
But was this this the only way? Can’t imagine everyone who deploys an RDS server needs to search Google for a solution that leads to running a powershell command.
Server 2k19 Here – Same problem and your solution fixed it.
Thank you… I dug and dug online and didn’t find anything until this.
Thank you, solved my problem too!
I spent a week searching the Internet for a resolution and found a ton of dead ends along the way and a very upset client – rightfully so. This was the only resolution that worked… Thanks for Sharing!!!
Same here, spent a lot of time until I find this, which is finally working.
I cannot run the second command
PS C:\Windows\system32> $obj.ChangeMode(4)
Exception calling “ChangeMode” : “Invalid operation ”
At line:1 char:1
+ $obj.ChangeMode(4)
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WMIMethodException
PS is ran under Administrator rights. Any suggestions onto why PS isn’t recognizing the command?
Hi Nikole,
have you run the first command without any issues?
If I want it to be per machine because I have workgroup (no domain) what is the command in this case?
Thank you so much, I have expended more than a week troubleshooting the same issue in windows server 2019.
You have saved me. wonderfully.
Solució Perfecta 1000 Gracies
Thank you so much!!!!!!
Worked for me as well – I’m guessing there’s a bug in the License Server selection when you assign via the gui.