Add new Session Host/VM's to Existing Azure Virtual Desktop Pool

Marius Sabou 1 Reputation point
2021-10-27T18:26:38.177+00:00

Hi Microsoft Team / Users

Do you know if it's possible VIA a PowerShell / Python script to automate a deployment of a new VM and get registered in the domain, and add it in the Azure Virtual Desktop hostpool.
We need this as to automate our proceess.

Appreciate our answers

Thanks
Sabou Marius

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,361 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,359 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,341 Reputation points
    2021-10-29T17:05:05.063+00:00

    Hello @Marius Sabou ,

    Thank you for your question and reaching out

    Instructions for adding new VM to AVD is outlined here in below Microsoft article , you can use PowerShell or Azure CLI.

    https://learn.microsoft.com/en-us/azure/virtual-desktop/create-host-pools-powershell?tabs=azure-powershell#register-the-virtual-machines-to-the-windows-virtual-desktop-host-pool

    Also , below is similar thread as per your scenario.
    https://learn.microsoft.com/en-us/answers/questions/110851/add-existing-azure-vm-to-session-host-pool-azure-w.html

    --------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  2. Marius Sabou 1 Reputation point
    2021-11-02T22:53:52.617+00:00

    Dear All,

    I succeed,
    The script check if the user is in DAG, and add it in case isn't, delete session host, delete old VM resources, create a new one where is joining in the domain and install required Virtual Desktop agent, and add automatically the user session host,
    If you need it i can post it here