Impossible to remove remote desktop license server

Solution 1:

I had the same error. Login with the SQL-Manager Server to the localhost.

\\.\pipe\MICROSOFT##WID\tsql\query

TSQL> To remove the orphaned Server with the ID 1005.
use RDCms
delete from rds.RoleRdsh where ServerId = ‘1005’

Dave Harris wrote a excelent blog to this issue.

https://dave.harris.uno/unable-to-remove-deleted-session-hosts-from-rds2012-deployment/