What it comes down to is this:

  1. Install the Remote Desktop Licensing and Remote Desktop Session Host roles
  2. Activate the RD License server and add some CALs
  3. Run Powershell as an Administrator - has to be the 64bit version as the x86 version doesn't appear to work properly
  4. Enter the following commands:
  • $obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
  • $obj.ChangeMode(TSMODE)
  • $obj.SetSpecifiedLicenseServerList("SERVERNAME")

Where TSMODE is either 2 for per device or 4 for per user. SERVERNAME is the hostname of the server you're configuring (or if you have the license server elsewhere, the name of it). You can check the license server has taken by running this command:

$obj.GetSpecifiedLicenseServerList()

Which should return the license server you set.