This is a quick snippet for all of you working with RDS in Server 2012+… and bemoaning the fact that Microsoft took something relatively simple and made it horribly convoluted…
In Powershell you can manually set a Session Host Server to use a specific licensing server and mode. To do so you run the following on the session host server.
$obj.SetSpecifiedLicenseServerList("servername.contoso.local")
$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.ChangeMode(VALUE)
First two commands specify the licensing server you want. Hence change servername.contoso.local to your environment. That’s only the first half though. You then need to set the licensing mode and that is what the second two commands do. Where it says VALUE you can enter in either a “2” or a “4” depending on the type of licensing you have.
2 = Per Device
4 = Per User
Hope this saves someone else some headache… I think the MS approved way to do this is probably to use group policy but this is a quick and dirty method if you just need to get a machine working quickly.