Forum Discussion

Ben79's avatar
Ben79
Copper Contributor
Jul 08, 2019
Solved

Unable to remove session host "Session host not found"

I'm trying to delete a test host pool that I created, but I'm unable to remove the session hosts. I have deleted the RemoteApps and the AppGroups, but when I try and delete the session host I get a powershell error:

 

WARNING: One or more errors occurred.
Remove-RdsSessionHost :
ActivityId:
Powershell commands to diagnose the failure:
Get-RdsDiagnosticActivities -ActivityId
At line:1 char:1
+ Remove-RdsSessionHost -TenantName $TenantName -HostPoolName $HostPool ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : FromStdErr: (Microsoft.RDInf...eRdsSessionHost:RemoveRdsSessionHost) [Remove-RdsSessionHost], RdsPowerShellException
+ FullyQualifiedErrorId : DefaultNoRdsError,Microsoft.RDInfra.RDPowershell.SessionHost.RemoveRdsSessionHost

 

I cant get any detail from the Get-RdsDiagnosticActivities command, as the activity doesn't appear for the command in the list.

 

The session host is there, I can see it using get-rdssession host, and I'm using the FQDN to try and delete, which exactly matches the SessionHostName that is outputted via the get command. If I use the shortname instead I get a different error saying "Specified SessionHostName %servname% does not exist in HostPoolName %hostpoolname%" (and that error is outputted into the RdsDiagnosticActivities)

 

Anyone run into this? I've tested creating a new host pool / session hosts, and the same is evident, I cannot remove the session hosts.

 

Thanks

 

Ben

 

19 Replies

  • michawets's avatar
    michawets
    Iron Contributor

    Hi Ben79,

     

    Are there any special characters in the name?

     

    Could you provide the full command that you try to execute?

    • Ben79's avatar
      Ben79
      Copper Contributor

      Thanks for the response michawets The session host name has a "-" in it, I don't know if that is causing any issues? The full command I'm trying is:

       

      Remove-RdsSessionHost -TenantName "RDSTest" -HostPoolName "TestPool" -Name "RDSTEST-2012-1.eu.ad"

       

      And that errors out with:

       

      WARNING: One or more errors occurred.
      Remove-RdsSessionHost :
      ActivityId:
      Powershell commands to diagnose the failure:
      Get-RdsDiagnosticActivities -ActivityId
      At line:1 char:1
      + Remove-RdsSessionHost -TenantName "RDSTest" -HostPoolName "Tes ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : FromStdErr: (Microsoft.RDInf...eRdsSessionHost:RemoveRdsSessionHost) [Remove-RdsSessionHost], RdsPowerShellException
      + FullyQualifiedErrorId : DefaultNoRdsError,Microsoft.RDInfra.RDPowershell.SessionHost.RemoveRdsSessionHost

       

      If I mistype the session host name / dont use the FQDN then I get another error:

       

      "Specified SessionHostName %%% does not exist in HostPoolName TestPool"

       

      So its the correct name, but I've no idea why I cannot delete it. I'll attempt to create another session host today with no "-" in the name and see if i'm able to delete that host.

       

       

       

      • Ben79's avatar
        Ben79
        Copper Contributor

        The "-" in the name is default when provisioning a host pool, which I had totally forgot. So that cant be anything to do with it. I've deployed another host pool into another tenant with corresponding session hosts, and the same issue is evident, I'm unable to remove them.

         

        Using the web front end as well fails. "Failed to delete host, problem with server. Please try again"

         

        Any help people can offer here would be appreciated, I've no idea what is going on.

Resources