Add a previously pool-member Azure VM to session host pool (Azure WVD)

Papp Károly 106 Reputation points
2021-11-17T13:58:00.963+00:00

Hello Colleagues,

I have accidentally deleted one of my hosts from the host pool...

guide: https://learn.microsoft.com/en-us/azure/virtual-desktop/create-host-pools-powershell

  1. did the updating section on the previously pool-membered VM based on the guideline provided above.
  2. reboot
  3. did the register section on the previously pool-membered VM based on the guideline provided above.
  4. reboot
  5. the VM still not appears in the pool. waited 1 hour, did a couple of reboots, no sign of the VM.

Uninstalled all of the previous versions of the Remote Desktop Agent.
RdAgent service still in the services list.
Programs and Features list has the RDS Genea Agent 44.31. and the SxS Network Stack, nothing else regarding RDS.

Any hint on how to join the VM to the pool? I don't want to redeploy it because I have it working just as before the delete.

Br,
Karoly

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,365 questions
0 comments No comments
{count} votes

Accepted answer
  1. Papp Károly 106 Reputation points
    2021-11-17T14:35:11.707+00:00

    Solved it!
    Which is shown as optional, it is mandatory to do during the "Update process"!

    Optionally, you can also remove the following registry settings:
    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDInfraAgent
    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDAgentBootLoader


3 additional answers

Sort by: Most helpful
  1. SenhorDolas 1,171 Reputation points
    2022-05-06T11:27:06.697+00:00

    Hi @Papp Károly ,

    How did you fix this? I also removed a host from a pool by accident! :)


  2. Sanya Khasenye 0 Reputation points
    2023-09-18T17:49:33.23+00:00

    Procedure (we start with steps 1 to 3 in order to reset the account password and Remote Desktop Connection configuration to allow you to log into the VM - otherwise you'll get an error that this has is currently being prevented by an administrator policy, or similar):

     

    1. Go to the virtual machine's properties in the Azure portal
    2. On the left of the VM properties, scroll down 'Reset Password' under 'Help'
    3. Enter the new password for the svc_local_admin account (you can use a temporary one of your own, but better to use the standard password for the local account name stored in a key vault) and then click 'Update'
    4. At this point you can now RDP to the VM and login with the local admin account svc_local_admin account and the password just updated
    5. When logged in, go to Add/Remove Programs and uninstall both the 'Remote Desktop Agent Bootloader'  and 'Remote Desktop Services Infrastructure Agent'
    6. Once done, open File Explorer and navigate to 'C:\DeployAgent' and ensure you have two subfolders there called 'RDAgentBootLoaderInstall' and 'RDInfraAgentInstall', both with MSI installers (if you don't have this path ot the installers are unavailable then these can be downloaded from here, for the agent, and here, for the boot loader.)
    7. We start with the Agent installation. You can either double-click the MSI installer in the 'C:\DeployAgent\RDInfraAgentInstall' folder (or where you've downloaded it to or, if you get ann error preventing the install, open a PowerShell Administrator shell session by opening PowerShell as Administrator, navigating to the MSI installer directory from PowerShell and running 'Start-Process -FilePath <path-to-the-agent-msi-installer>' 
    8. When the enter token dialog appears (see below) then copy and paste the token from either a key vault relevant to the host pool you're manually adding the VM to 

     

    or go to Azure Virtual Desktop in Azure, click Host Pools and then click to select the host pool you want to add the VM to and then click 'Registration Key' to display the registration token for the pool (see below) and copy and paste this into the token dialog text box to proceed

     

     

    1. When done, we the go the agent boot loader installation. You can either double-click the MSI installer in the 'C:\DeployAgent\RDAgentBootLoaderInstall' folder (or where you've downloaded it to or, if you get ann error preventing the install, open a PowerShell Administrator shell session by opening PowerShell as Administrator, navigating to the boot loader MSI installer directory from PowerShell and running 'Start-Process -FilePath <path-to-the-agent-boot-loader-msi-installer>'
    2. When do, return to 'Add/Remove Programs' to check that the Agent and BootLoader have been successfully installed.

     

    After these steps, you can navigate back to the Azure portal > Azure Virtual Desktop > Host Pools and then click to select the target host pool  and then click on 'Total Machines' or Session Hosts on the left to verify that the VM has been added back to the host pool. You may need to wait up to a minute to see it and wait a few seconds before its status changes from Unavailable to Available. If it doesn't appear, then it's likely that the host pool Registration Token use was incorrect.

    0 comments No comments

  3. Sanya Khasenye 0 Reputation points
    2023-09-19T06:40:56.9533333+00:00

    I'll add an alternative way of doing this by PowerShell script which updates the registry