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”)
- Ensure that your account is a local admin on the server
- Ensure that you are launching Powershell as an administrator
- Ensure that Group Policy is not preventing you from making this change
- 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
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! 🙂