How to configure RDP properties for a Host Pool - Display settings
The series of posts on configuring RDP properties for a host pool is ending. In this latest post, I’ll show you how to configure display settings for your Azure virtual desktop environment using PowerShell and the Azure CLI. Ok, let’s go through each setting one by one.
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 Local devices redirection #
To set a custom RDP property, you should use the Update-AzWvdHostPool cmdlet.
Multiple displays #
This setting determines whether the session should use true multi-monitor support when connecting to the remote computer. These are the accepted values.
- use multimon:i:0 - Don’t enable multiple display support.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:0"
- use multimon:i:1 - Enable multiple display support.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:1"
Selected monitors #
This setting specifies which local screens to use from the remote session. These are the accepted values.
Important: Requires the setting “use multimon” to be set to 1.
- use multimon:i:1;selectedmonitors:s: - All displays.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:1;selectedmonitors:s:"
- use multimon:i:1;selectedmonitors:s:IDXXXX,IDXXXX - Manually enter list of machine-specific display IDs. The selected screens must be contiguous.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:1;selectedmonitors:s:ID5555,ID7722"
Maximize to current displays #
This setting determines which screen the remote session goes full screen on when maximized. These are the accepted values.
Important: Requires the setting “use multimon” to be set to 1.
- use multimon:i:1;maximizetocurrentdisplays:i:0 - Session goes full screen on the displays initially selected when maximizing.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:1;maximizetocurrentdisplays:i:0"
- use multimon:i:1;maximizetocurrentdisplays:i:1 - Session dynamically goes full screen on the displays touched by the session window when maximizing.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:1;maximizetocurrentdisplays:i:1"
Multi to single display switch #
This setting determines whether a multi-screen remote session automatically switches to a single screen when exiting full screen. These are the accepted values.
Important: Requires the setting multimon to be set to 1.
- use multimon:i:1;singlemoninwindowedmode:i:0 - Session retains all displays when exiting full screen.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:1;singlemoninwindowedmode:i:0"
- use multimon:i:1;singlemoninwindowedmode:i:1 - Session switches to single display when exiting full screen.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "use multimon:i:1;singlemoninwindowedmode:i:1"
Screen mode #
This setting determines whether the remote session window appears full screen when connected to the remote computer. These are the accepted values.
- screen mode id:i:1 - The remote session will appear in a window.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "screen mode id:i:1"
- screen mode id:i:2 - The remote session will appear full screen.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "screen mode id:i:2"
Smart sizing #
This setting determines whether the client computer should scale content on the remote computer to fit the client computer’s window size when the window is resized. These are the accepted values.
- smart sizing:i:0 - The local window content won’t scale when resized.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "smart sizing:i:0"
- smart sizing:i:1 - The local window content will scale when resized.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "smart sizing:i:1"
Dynamic resolution #
This setting determines whether the remote session resolution is automatically updated when resizing the local window. These are the accepted values.
- dynamic resolution:i:0 - Session resolution remains static for the duration of the session.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "dynamic resolution:i:0"
- dynamic resolution:i:1 - Session resolution update as the local window resizes.
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "dynamic resolution:i:1"
Desktop size #
This setting specifies the default dimensions of the remote session desktop. These are the accepted values.
- desktop size id:i:0 - 640 x 480
- desktop size id:i:1 - 800 x 600
- desktop size id:i:2 - 1024 x 768
- desktop size id:i:3 - 1280 x 1024
- desktop size id:i:4 - 1600 x 1200
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "desktop size id:i:3"
**Desktop height (pixels) ** #
This setting sets the height of the remote session’s desktop (in pixels). Accepted values are between 200 and 8192.
- desktopheight:i:value
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "desktopheight:i:1920"
Desktop width (pixels) #
This setting sets the width of the remote session’s desktop (in pixels). Accepted values are between 200 and 8192.
- desktopwidth:i:value
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "desktopwidth:i:1080"
Desktop scale factor #
This setting specifies the scale factor of the remote session to make the content appear larger. These are the accepted values.
- desktopscalefactor:i:100
- desktopscalefactor:i:125
- desktopscalefactor:i:150
- desktopscalefactor:i:175
- desktopscalefactor:i:200
- desktopscalefactor:i:250
- desktopscalefactor:i:300
- desktopscalefactor:i:400
- desktopscalefactor:i:500
Update-AzWvdHostPool `
-Name $hostPoolName `
-ResourceGroupName $resourceGroupName `
-CustomRdpProperty "desktopscalefactor:i:150"
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 "desktopheight:i:1920;desktopwidth:i:1080"
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 Local devices redirection #
To set a custom RDP property, you should use the following command.
Multiple displays #
This setting determines whether the session should use true multi-monitor support when connecting to the remote computer. These are the accepted values.
- use multimon:i:0 - Don’t enable multiple display support.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:0"
- use multimon:i:1 - Enable multiple display support.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:1"
Selected monitors #
This setting specifies which local screens to use from the remote session. These are the accepted values.
Important: Requires the setting “use multimon” to be set to 1.
- use multimon:i:1;selectedmonitors:s: - All displays.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:1;selectedmonitors:s:"
- use multimon:i:1;selectedmonitors:s:IDXXXX,IDXXXX - Manually enter list of machine specific display IDs. The selected screens must be contiguous.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:1;selectedmonitors:s:ID5555,ID7722"
Maximize to current displays #
This setting determines which screen the remote session goes full screen on when maximized. These are the accepted values.
Important: Requires the setting “use multimon” to be set to 1.
- use multimon:i:1;maximizetocurrentdisplays:i:0 - Session goes full screen on the displays initially selected when maximizing.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:1;maximizetocurrentdisplays:i:0"
- use multimon:i:1;maximizetocurrentdisplays:i:1 - Session dynamically goes full screen on the displays touched by the session window when maximizing.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:1;maximizetocurrentdisplays:i:1"
Multi to single display switch #
This setting determines whether a multi-screen remote session automatically switches to a single screen when exiting full screen. These are the accepted values.
Important: Requires the setting “use multimon” to be set to 1.
- use multimon:i:1;singlemoninwindowedmode:i:0 - Session retains all displays when exiting full screen.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:1;singlemoninwindowedmode:i:0"
- use multimon:i:1;singlemoninwindowedmode:i:1 - Session switches to single display when exiting full screen.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "use multimon:i:1;singlemoninwindowedmode:i:1"
Screen mode #
This setting determines whether the remote session window appears full screen when connected to the remote computer. These are the accepted values.
- screen mode id:i:1 - The remote session will appear in a window.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "screen mode id:i:1"
- screen mode id:i:2 - The remote session will appear full screen.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "screen mode id:i:2"
Smart sizing #
This setting determines whether the client computer should scale content on the remote computer to fit the client computer’s window size when the window is resized. These are the accepted values.
- smart sizing:i:0 - The local window content won’t scale when resized.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "smart sizing:i:0"
- smart sizing:i:1 - The local window content will scale when resized.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "smart sizing:i:1"
Dynamic resolution #
This setting determines whether the remote session resolution is automatically updated when resizing the local window. These are the accepted values.
- dynamic resolution:i:0 - Session resolution remains static for the duration of the session.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "dynamic resolution:i:0"
- dynamic resolution:i:1 - Session resolution update as the local window resizes.
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "dynamic resolution:i:1"
Desktop size #
This setting specifies the default dimensions of the remote session desktop. These are the accepted values.
- desktop size id:i:0 - 640 x 480
- desktop size id:i:1 - 800 x 600
- desktop size id:i:2 - 1024 x 768
- desktop size id:i:3 - 1280 x 1024
- desktop size id:i:4 - 1600 x 1200
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "desktop size id:i:3"
**Desktop height (pixels) ** #
This setting sets the height of the remote session’s desktop (in pixels). Accepted values are between 200 and 8192.
- desktopheight:i:value
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "desktopheight:i:1920"
Desktop width (pixels) #
This setting sets the width of the remote session’s desktop (in pixels). Accepted values are between 200 and 8192.
- desktopwidth:i:value
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "desktopwidth:i:1080"
Desktop scale factor #
This setting specifies the scale factor of the remote session to make the content appear larger. These are the accepted values.
- desktopscalefactor:i:100
- desktopscalefactor:i:125
- desktopscalefactor:i:150
- desktopscalefactor:i:175
- desktopscalefactor:i:200
- desktopscalefactor:i:250
- desktopscalefactor:i:300
- desktopscalefactor:i:400
- desktopscalefactor:i:500
az desktopvirtualization hostpool update \
--name $hostPoolName \
--resource-group $resourceGroupName \
--custom-rdp-property "desktopscalefactor:i:150"
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 "desktopheight:i:1920;desktopwidth:i:1080"
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.
Check out this link to learn more about supported RDP settings.