15 April 2016

Specify RDS Licensing Server from Session Host - 2012 R2

Earlier today I was setting up two new Session Hosts for a client, where we were creating a new collection.  Setting up the first one worked fine, but when logging into the second one, I noticed a message saying that there was no licenses for this server (for RDS) and it will stop working after 119 days.  Obviously there were licenses on the Licensing server, but for some reason this server couldn't communicate to it to find out.

When checking the RD Licensing Diagnoser, it confirmed that there was no licensing server linked to this Session Host.  I had a look online for a way to set this up using the GUI (on either the RDS Gateway/Licensing Server, or the Session Host, but couldn't find anything.

It's a nice and simple command (there's actually two of them) that is done through PowerShell to get it all working.  The command is the following:

Command #1
$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting

Command #2

$obj.GetSpecifiedLicenseServerList("license.contoso.com")

"License" is the name of the RDS License Server in the environment.

After doing this, all I had to do was refresh the RD Licensing Diagnoser, and it accurately reflected the licensing server, and the amount of licenses I had etc.

No comments:

Post a Comment