provision Windows Virtual Desktop

Roger Roger 4,951 Reputation points
2021-07-18T22:50:38.807+00:00

Hi All

I am using WVD classic, i am using github tool to provision wvd. if i want to provision by connecting to rdsAccount is the below syntax correct.

Install-Module -Name Microsoft.RDInfra.RDPowerShell
Import-Module -Name Microsoft.RDInfra.RDPowerShell
Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
Add-RdsAppGroupUser -TenantName "MyTenant" -HostPoolName "WVD" -AppGroupName "MyGroup" -UserPrincipalName "user1@Company portal .com"

What is the syntax to know whether WVD(RdsSessionHost) is provisioned for the user or not.

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

Accepted answer
  1. prmanhas-MSFT 17,886 Reputation points Microsoft Employee
    2021-07-20T10:38:48.97+00:00

    @Roger Roger Apologies for the delay in response and all the inconvenience caused because of the issue.

    Firstly I would like to suggest you to go for ARM based deployment rather than classic ones since Classic models will soon be deprecated and there are not current updates as well being push to classic deployments. So rather than going through headache of configuring everything or migrating the current resource or deployment to ARM starting with ARM is the best suggestion. Again it is totally upto you and it is just a suggestion from my side :). You can read more about it here.

    Now coming to your query as mentioned here your commands are right. I am just mentioning below the script which I use generally and is similar to yours. The mentioned command above by you should work fine and is completely correct.

    This step is required to install the necessary PowerShell module to run any of the WVD or RDS command-lets. Install is only required once. But it doesn't hurt to run these again to ensure you have the latest updates.

    Install-Module -Name Microsoft.RDInfra.RDPowerShell -Force
    Import-Module -Name Microsoft.RDInfra.RDPowerShell -Force
    $brokerurl = "https://rdbroker.wvd.microsoft.com"
    $aadTenantId = "The Azure AD Tenant ID "
    $azureSubscriptionId = "The Subscription ID "

    The Add-RdsAccount command will log you into the WVD Platform Service, the account used here should be the same account you granted Tenant Creator

    Add-RdsAccount -DeploymentUrl $brokerurl

    The New-RDSTenant command-let will provision your new Tenant this will use your AAD Tenant ID and Subscription ID variables defined above

    New-RdsTenant -Name "yourWVDTenantNamehere" -AadTenantId $aadTenantId -AzureSubscriptionId $azureSubscriptionId

    Add-RdsAppGroupUser -TenantName "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD Desktop" -UserPrincipalName "example@mydomain.com"

    Now if you want to whether WVD(RdsSessionHost) is provisioned for the user or not you can use below script:

    Get-RdsSessionHost -TenantName "MyTenant" -HostPoolName "MyPool" | Where-Object -Property AssignedUser -Eq 'user2@Company portal .com'

    See this for example.

    Hope it helps!!!

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    0 comments No comments

0 additional answers

Sort by: Most helpful