Setting RDS/TS Licensing Server via WMI results in “Invalid Operation”

coollogo_com-79311929Background Info

So I was chugging right along, I issued a command like the one below and then all of a sudden I received an “Invalid Operation” error. What should I try to resolve this error?

$obj = gwmi -namespace “Root/CIMV2/TerminalServices” Win32_TerminalServiceSetting
$obj.SetSpecifiedLicenseServerList(“licensingserver”)

SetSpecifiedLicenseServerList

 

  1. Ensure that your account is a local admin on the server
  2. Ensure that you are launching Powershell as an administrator
  3. Ensure that Group Policy is not preventing you from making this change
    1. Browse to Computer Configuration -> Administrative Templates, Windows Templates, Terminal Services

Note: This “invalid operation” error can also appear when using the RemoveLSFromSpecifiedLicenseServerList and EmptySpecifiedLicenseServerList methods.

Sources

http://www.blackforce.co.uk/2014/02/17/2012-rds-server-the-remote-desktop-session-host-server-does-not-have-a-remote-desktop-license-server-specified
https://msdn.microsoft.com/en-us/library/windows/desktop/ff955672(v=vs.85).aspx

One thought to “Setting RDS/TS Licensing Server via WMI results in “Invalid Operation””

  1. Also, it may be obvious, but ensure at least the “Remote Desktop Session Host” role is installed first! I ran into this issue where a co-worker informed me he had done this role install but I was getting these “invalid operation” errors in Powershell when trying to set the license server. Turns out the RDSH role wasn’t installed! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.