How do I get that machine back in the session host list?

Brass Contributor
Hi, I had 20 machines in hostpool. I executed the below command Remove-RdsSessionhost -TenantName "test" -HostPoolName "testpool" -Name "test15.xyz.com" Now when I do get-rdssessionhost, it gives me the list of 19 machines (test15 not in the list) When I try to do Set-rdssessionhost and assign it to any user, i get error saying the machine is not the part of hostpool. How do I get that machine back in the session host list? Please help! Regards, Yash
11 Replies
you will need to re-register the session host to your hostpool. You can follow the hostpool registration step in the following:
https://docs.microsoft.com/en-us/azure/virtual-desktop/create-host-pools-powershell

@Soo Kuan Teo 

Thanks for your response.

I tried to follow the steps, however, while installing Windows Virtual Desktop Agent, it didn't asked me for registration token. Installation got completed for both Windows Virtual Desktop Agent and Windows Virtual Desktop Agent Bootloader. I still do not see the host in Get-RdsSessionHost

 

@yashsedani,

please goto control panel, uninstall the agent, then reinstall the agent again. You should see the attached screenshot where you can input the registration token.

 

@Soo Kuan Teo 

I tried installing both Agent and BootLoader again with provided the valid token while installing agent, still it didn't helped.

Can you please check the regkey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDInfraAgent, IsRegistered should be 1, and RegistrationToken should be empty. Also please look at event log application to see there are any error messages from RDAgentBootLoader.

@Soo Kuan Teo 

There was no IsRegistered key so i added 1 DWORD-32 and changed value to 1, RegisterationInfo was showing the old Token ID, i kept it blank now. I tried reinstalling agent with new token (as the earlier one was expired) but still it wont show up in session host list.

There are 3 repeat events errors for RDAgentBootLoader, refer 1,2,3 in the attached.

@yashsedani 

Thanks for the info! the agent is not registering correctly. It is very possible that the downloaded agent package is corrupted. Here's the detailed instruction to recover:

1. Go to control panel, uninstall bootloader first then uninstall the agent. See attached uninstall.png

2. Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDAgentBootLoader and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDInfraAgent keys, make sure these keys for gone. See attached regkey.png.

3. Download both the bootloader and agent from: https://docs.microsoft.com/en-us/azure/virtual-desktop/create-host-pools-powershell

4. have the new or unexpired registration token ready

5. Install the agent first with the valid token

6. install the bootloader

 

 

 

 

 

@Soo Kuan Teo 

After uninstalling both Agent and Bootloader, there is no registry for both. When i reinstall, it takes the old token (when machine was first created) from somewhere and there is no IsRegistered key (same as before)

Do you see any new event logs from agent?

@Soo Kuan Teo

I see same Error Events logs. 

Can you please check other event logs from the agent? the event log you provided is from the bootloader which is good that it is working as expected. It will give more hint what fail from the agent event logs. From the build 1288, the source should be "WVD-Agent", or "Transport", or something similar. Thanks for your patience.