SOLVED

Unable to remove session host "Session host not found"

Copper Contributor

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

Hi @Ben79,

 

Are there any special characters in the name?

 

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

Does the command succeed using -Force or is the same error thrown?

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.

 

 

 

hey @anthonyschneider365, unfortunately not, the same error occurs using the -force

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.

Hi @Ben79 ,

 

Could you run a Get-RdsSessionHost for the same sessionhost? Could you post the output?

 

Thx

Hey @michawets here is the output:

 

Get-RdsSessionHost -TenantName $TenantName -HostPoolName $HostPoolName

 

SessionHostName : RDSTEST-2012-1.eu.ad
TenantName : RDSTest
TenantGroupName : Default Tenant Group
HostPoolName : TestWin2008Pool
AllowNewSession : True
Sessions : 0
LastHeartBeat : 23/07/2019 12:31:05
AgentVersion : 1.0.833.5
AssignedUser :
OsVersion : 6.3.9600
SxSStackVersion : rdp-sxs190429002
Status : Available
UpdateState : Succeeded
LastUpdateTime : 22/07/2019 12:10:09
UpdateErrorMessage :

 

Piping the Get-RdsSessionHost host command to a remove session host, provides the exact same error as well.

Hi @Ben79 ,

 

Could you install Fiddler?

Then

  • close Powershell
  • start Fiddler
  • start Powershell
  • redo the Remove-RdsSessionHost
  • check the Fiddler output, looking for a call to TenantGroups/{tenantGroupName}/Tenants/{tenantName}/HostPools/{hostPoolName}/SessionHosts/{sessionHostName}

Could you share the outcome of the HTTP call?

Especially in the Inspectors, in the Response, the Raw output could be usefull

hey @michawets, please find below the output:

 

DELETE /RdsManagement/V1/TenantGroups/Default%20Tenant%20Group/Tenants/RDSTest/HostPools/TestWin2008Pool/SessionHosts/RDSTEST-2012-1.eu.ad?Force=False HTTP/1.1

 

The response is:

HTTP/1.1 404 Not Found

 

Text View =

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

 

 

@Ben79 : Did the deletion work? Can you check that the host pool exists?

hey @Christian_Montoya, no the deletion didn't work. The session host is still present.

 

@Ben79 : Sorry, can you confirm what you mean? Are you saying

- The session host (in Windows Virtual Desktop) is still present? or...

- The virtual machine (in Azure) is still present?

 

I've looked at the backend and I no longer see the host pool and session hosts you created in Windows Virtual Desktop. However, Remove-RdsSessionHost does not delete the virtual machine in Azure, if that's what you were intending to do.

Hi @Christian_Montoya ,

 

I was wondering the same, that's why I asked @Ben79 to do the Get-RdsSessionHost (a few posts back).

And that seemed to be working.

 

@Ben79 , could you do a Get-RdsHostPool to validate the existence of the hostpool through Powershell? 

Hello @michawets @Christian_Montoya 

 

The session hosts and the VM's are still present after running the command. I didn’t realize you had access to the back end here, and so I had removed the company specific information from the commands I was running.

 

Below is the exact command / output I get:

 

Get-RdsSessionHost -TenantName "MonsterRDSTest" -HostPoolName "TestWin2008Pool"

 

SessionHostName    : RDSTEST-2012-1.eu.global.ad

TenantName         : MonsterRDSTest

TenantGroupName    : Default Tenant Group

HostPoolName       : TestWin2008Pool

AllowNewSession    : True

Sessions           : 0

LastHeartBeat      : 23/07/2019 12:35:36

AgentVersion       : 1.0.833.5

AssignedUser       :

OsVersion          : 6.3.9600

SxSStackVersion    : rdp-sxs190429002

Status             : NoHeartbeat

UpdateState        : Succeeded

LastUpdateTime     : 22/07/2019 12:10:09

UpdateErrorMessage :

 

 

Remove-RdsSessionHost -TenantName "MonsterRDSTest" -HostPoolName "TestWin2008Pool" -Name "RDSTEST-2012-1.eu.global.ad"

 

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 "MonsterRDSTest" -HostPoolName "Tes ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : FromStdErr: (Microsoft.RDInf...eRdsSessionHost:RemoveRdsSessionHost) [Remove-RdsSessionHost], RdsPowerShellException

    + FullyQualifiedErrorId : DefaultNoRdsError,Microsoft.RDInfra.RDPowershell.SessionHost.RemoveRdsSessionHost

 

Fiddler:

 

DELETE /RdsManagement/V1/TenantGroups/Default%20Tenant%20Group/Tenants/MonsterRDSTest/HostPools/TestWin2008Pool/SessionHosts/RDSTEST-2012-1.eu.global.ad?Force=False HTTP/1.1

 

HTTP/1.1 404 Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.


Thanks

 

Ben

 

 

@Ben79 : No worries. Also, if you would like to keep the tenant name and host pool names confidential, feel free to send in a private message.

 

When you run the Remove cmdlet, I noticed you're not using the "-Force" parameter. Does it immediately fail? Can you try running it with the "-Force" parameter, as well? If that works only with the "-Force" parameter, then we either need to make it more clear or actually allow the operation with confirmation.

Hey @Christian_Montoya 

 

Even using the -force it immediately fails with the exactly the same error.

 

Thanks

 

Ben

 

Does anyone have any ideas on this one? I'm utterly stuck and unable to make any more progress on the proof of concept of the tech.

 

Any light someone can throw I would appreciate.

 

Thanks

 

@Ben79 for whatever reason Microsoft has blocked the domain suffix 'ad' in their WVD deployment so you have to open a case any time you want to delete a Session host that uses that DNS suffix.

 

To speed things up reference Bug ID: 23462425

 

Here's the complete list of blocked suffixes in case it helps others:

 

<add fileExtension=".asa" allowed="false" />

          <add fileExtension=".asax" allowed="false" />

          <add fileExtension=".ascx" allowed="false" />

          <add fileExtension=".master" allowed="false" />

          <add fileExtension=".skin" allowed="false" />

          <add fileExtension=".browser" allowed="false" />

          <add fileExtension=".sitemap" allowed="false" />

          <add fileExtension=".config" allowed="false" />

          <add fileExtension=".cs" allowed="false" />

          <add fileExtension=".csproj" allowed="false" />

          <add fileExtension=".vb" allowed="false" />

          <add fileExtension=".vbproj" allowed="false" />

          <add fileExtension=".webinfo" allowed="false" />

          <add fileExtension=".licx" allowed="false" />

          <add fileExtension=".resx" allowed="false" />

          <add fileExtension=".resources" allowed="false" />

          <add fileExtension=".mdb" allowed="false" />

          <add fileExtension=".vjsproj" allowed="false" />

          <add fileExtension=".java" allowed="false" />

          <add fileExtension=".jsl" allowed="false" />

          <add fileExtension=".ldb" allowed="false" />

          <add fileExtension=".dsdgm" allowed="false" />

          <add fileExtension=".ssdgm" allowed="false" />

          <add fileExtension=".lsad" allowed="false" />

          <add fileExtension=".ssmap" allowed="false" />

          <add fileExtension=".cd" allowed="false" />

          <add fileExtension=".dsprototype" allowed="false" />

          <add fileExtension=".lsaprototype" allowed="false" />

          <add fileExtension=".sdm" allowed="false" />

          <add fileExtension=".sdmDocument" allowed="false" />

          <add fileExtension=".mdf" allowed="false" />

          <add fileExtension=".ldf" allowed="false" />

          <add fileExtension=".ad" allowed="false" />

          <add fileExtension=".dd" allowed="false" />

          <add fileExtension=".ldd" allowed="false" />

          <add fileExtension=".sd" allowed="false" />

          <add fileExtension=".adprototype" allowed="false" />

          <add fileExtension=".lddprototype" allowed="false" />

          <add fileExtension=".exclude" allowed="false" />

          <add fileExtension=".refresh" allowed="false" />

          <add fileExtension=".compiled" allowed="false" />

          <add fileExtension=".msgx" allowed="false" />

          <add fileExtension=".vsdisco" allowed="false" />

          <add fileExtension=".rules" allowed="false" />

 

 

 

 

 

 

 

best response confirmed by Yendor23 (Microsoft)
Solution

@zmottie 

 

This worked for me and in this order. 

Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
Set-RdsHostPool -TenantName $myTenantName -Name "contosoHostPool" -ValidationEnv $true
Add-RdsAccount -DeploymentUrl "https://rdbroker-r0.wvd.microsoft.com"
1 best response

Accepted Solutions
best response confirmed by Yendor23 (Microsoft)
Solution

@zmottie 

 

This worked for me and in this order. 

Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
Set-RdsHostPool -TenantName $myTenantName -Name "contosoHostPool" -ValidationEnv $true
Add-RdsAccount -DeploymentUrl "https://rdbroker-r0.wvd.microsoft.com"

View solution in original post