How to configure RDP properties for a Host Pool - Connection Information
Hi everyone, I showed you how to create an Azure Virtual Desktop host pool in my previous article. This article shows how to configure the connection information tab of the RDP properties for the host pool using PowerShell and Azure CLI.
Azure PowerShell Workaround #
First, you need to ensure the Az.DesktopVirtualization module is installed on your computer and imported into your Powershell session. To do that, you should use the following commands.
Install-Module Az.DesktopVirtualization
Import-Module Az.DesktopVirtualization
Once you’ve imported the module, you’re ready to go. The easiest way to get started is to log in interactively at the command line.
Connect-AzAccount
This cmdlet will bring up a dialog box prompting you for your email address and password associated with your Azure account. You can choose the default subscription if you have more than one associated with your mail account. To perform this task, we will use the following commands:
Get-AzSubscription
Select-AzSubscription -Subscription "My Subscription"
Once you set your default subscription, you’re ready to start.
Set the variables #
Here, we define the characteristics of our environment and the resource’s properties.
$resourceGroupName="RG-DEMO-WE"
$hostPoolName="HP-DEMO-WE"
Define RDP properties for the connection Information #
To set a custom RDP property, you should use the Update-AzWvdHostPool cmdlet.
Credential Security Support Provider #
This setting specifies if Remote Desktop will use CredSSP for authentication. Here two possible values are accepted.
- enablecredsspsupport:i:1 - RDP will use CredSSP if the operating system supports CredSSP.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "enablecredsspsupport:i:1"
- enablecredsspsupport:i:0 - RDP will not use CredSSP, even if the operating system supports CredSSP.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "enablecredsspsupport:i:0"
Alternate shell #
This setting defines a program that will start automatically when a user session starts. The path to that app should be defined as a local path.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "alternate shell:s:C\:\\windows\\system32\\cmd.exe"
KDC proxy name #
This setting defines the KDC proxy URL using the fully qualified domain name (FQDN).
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "kdcproxyname:s:kdc.jorgebernhardt.com"
Define multiple custom RDP properties #
You should use the Update-AzWvdHostPool cmdlet with the following syntax to set multiple custom RDP properties.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "enablecredsspsupport:i:1;alternate shell:s:C\:\\windows\\system32\\cmd.exe;kdcproxyname:s:kdc.jorgebernhardt.com"
And verify your changes with the Get-AzWvdHostPool cmdlet.
Get-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
| format-list Name, CustomRdpProperty
Reset all custom RDP properties #
If you want to reset all custom RDP properties, you should use the Update-AzWvdHostPool cmdlet with the following syntax.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty ""
Azure CLI Workaround #
In this case, we will use Azure Cloud Shell, a browser-based shell built into Azure Portal. This allows us to use the Azure command-line tools (Azure CLI and Azure PowerShell) directly from a browser. If you want to know more about Azure Cloud Shell, check out this link. First, we define the characteristics of our environment and store the values in variables.
resourceGroupName="RG-DEMO-WE"
hostPoolName="HP-DEMO-WE"
Define RDP properties for the connection Information #
To set a custom RDP property, you should use the following command.
Credential Security Support Provider #
This setting specifies if Remote Desktop will use CredSSP for authentication. Here two possible values are accepted.
- enablecredsspsupport:i:1 - RDP will use CredSSP if the operating system supports CredSSP.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "enablecredsspsupport:i:1"
- enablecredsspsupport:i:0 - RDP will not use CredSSP, even if the operating system supports CredSSP.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "enablecredsspsupport:i:0"
Alternate shell #
This setting defines a program that will start automatically when a user session starts. The path to that app should be defined as a local path.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "alternate shell:s:C\:\\windows\\system32\\cmd.exe"
KDC proxy name #
This setting defines the KDC proxy URL using the fully qualified domain name (FQDN).
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "kdcproxyname:s:kdc.jorgebernhardt.com"
Define multiple custom RDP properties #
To set multiple custom RDP properties, you should use the following command.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "enablecredsspsupport:i:1;alternate shell:s:C\:\\windows\\system32\\cmd.exe;kdcproxyname:s:kdc.jorgebernhardt.com"
And verify your changes with the following command.
az desktopvirtualization hostpool show \
--name $hostPoolName \
--resource-group $resourceGroupName \
--query "[name, customRdpProperty]"
Reset all custom RDP properties #
If you want to reset all custom RDP properties, you should use the following command.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property ""
Thanks for reading my post. I hope you find it helpful.
In the next article, I’ll explain how to configure RDP properties for a Host Pool - Session behaviour.
Check out this link if you want to know more about Azure Virtual Desktop.