Find the license server of a Remote Desktop Session Host

One PowerShell line shows which Remote Desktop license server an RD Session Host is configured to use.

In a Remote Desktop Services (RDS) environment you often need to know which server holds the licenses: to add or remove licenses, to troubleshoot, or to report on usage. The license server can run on the same machine as the Remote Desktop Session Host (RDSH) or on a separate one with the Remote Desktop Licensing role service installed.

The command

Run this in an elevated PowerShell session on the session host:

(Get-WmiObject -NameSpace root\CIMV2\TerminalServices Win32_TerminalServiceSetting).GetSpecifiedLicenseServerList()

It queries the Win32_TerminalServiceSetting class in the TerminalServices WMI namespace. Its GetSpecifiedLicenseServerList() method returns the license servers configured on that host.

More options are documented in the reference for Get-WmiObject.

Join the discussion

Comments are hosted on comments.vciso.ch, a server I run myself. Nothing is loaded from it until you press the button below. Loading comments connects your browser to that server, and signing in with GitHub sets a cookie there. See the privacy page for details.

Type to search.

↑ ↓ to move, Enter to open, Esc to close