How to Add a VM (Session Host ) to Hostpool in Azure Virtual Desktop

Hirdesh Baghel 20 Reputation points
2024-12-19T13:06:07.6566667+00:00

Hi

I am working on one powershell script to automate Hostpool and SessionHost creation. I have created one VM using (New-AzVM ) Cmdlet. Now I am trying to add this vm to Hostpool as SessionHost. But could not find any relevant resources to do the same.

Kindly help !!!

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,624 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,708 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 113.3K Reputation points MVP
    2024-12-19T15:02:21.2733333+00:00

    Hi @Hirdesh Baghel ,

    first step: Create a registration key: Generate a registration key

    second step: register existing VM to a Hostpool: Register session hosts to a host pool

    The command line registering needs to be executed "inside" the VM you want to add to the Hostpool.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.