Remove Orphan Session Host from RDS Collection

Shane Wheeler 26 Reputation points
2021-03-30T04:51:20.957+00:00

Hi All, I have a collection that has an orphan RDSH server. The server is within AD but the VM had been removed so it doesn't exist. I would like to remove this from our collection because I must add some more remote apps to the collection. I see it within the Collection Host Servers but I cannot remove it from the GUI. - unable to set properties in the database. Value cannot be null. sddlform. Powershell Remove-RDSessionHost -SessionHostName @("RDSH") -ConnectionBrokerName "RDCB" -Force Error: RD session host servers are part of a session collection. did not validate successfully. Any help would be appreciated.

Windows for business | Windows Client for IT Pros | User experience | Remote desktop services and terminal services
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-03-31T02:05:16.727+00:00

    Hello @Shane Wheeler

    There are 3 ways that I could find:

    1. if a server doesn't exist anymore,the powershell won't remove it. So we need to re-attach the previous server then remove it;
    2. One user reported that simply create an AD computer object with the orphaned server name, then remove the server.
      No need to install an actual server with the name;
    3. Download the ‘SQL Management Studio’ software on your connection broker, see https://www.petenetlive.com/KB/Article/0001415

    Best Regards
    Karlie

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Shane Wheeler 26 Reputation points
    2021-03-31T02:12:55.463+00:00

    Hi Karlie, I have the computer object available but not the VM.
    That's how I can gain access to the collection because the object is still available but doesn't work when I try and remove it from the collection
    I did see the SQL option but thought I would ask in cause, I will give it a go and see how that pans out.


  2. Shane Wheeler 26 Reputation points
    2021-04-06T00:00:07.977+00:00

    Thank Karlie, worked well

    0 comments No comments

  3. Dave K 21 Reputation points
    2022-03-03T20:13:51.673+00:00

    Has anything changed with this behavior in the last 6-8 months or so? I encountered this same issue way back - RDSH server deleted before being properly removed from the RDS configuration, thus being orphaned and unable to be removed using the UI. Any attempts to remove them would result in an error and they would not 'go away'. I had to use the linked article, or one like it, to remove orphaned RDSH servers back then. I just had a few servers that were recently orphaned (The VMs were deleted), and for whatever reason (Maybe I'm just crazy lol), I tried removing them using the UI, and I got a 'completed with errors' removing the RDSH from the collection it was assigned to, I was then able to remove the collection, and then I went to 'RDS > Servers' and removed the server there, got an error, but... It's gone (Before, it would error and the machine would never go away). I pulled up SSMS and queried the DB to see what it contained, and the server doesn't appear to exist in the database any more. So it seems either this is some sort of cosmic fluke, or something's changed, which if something's changed, that would be great, as I can't imagine a reason to not be able to delete an orphaned server from the UI, with some sort of message like 'make sure this server is offline permanently' similar to how you can delete a dead DC from AD from within ADUC since 2003 or 2008 (don't recall exactly when that became possible), prior to that, to delete a dead DC was messy as you had to get into ADSIEdit and such.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.