Forum Discussion
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
This worked for me and in this order.
Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
Set-RdsHostPool -TenantName $myTenantName -Name "contosoHostPool" -ValidationEnv $trueAdd-RdsAccount -DeploymentUrl "https://rdbroker-r0.wvd.microsoft.com"
19 Replies
- anthonyschneider365Copper ContributorDoes the command succeed using -Force or is the same error thrown?
- Ben79Copper Contributor
hey anthonyschneider365, unfortunately not, the same error occurs using the -force
- Ben79Copper 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.RemoveRdsSessionHostIf 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.
- Ben79Copper 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.