Today I want to show you how to configure Device redirections for your Azure Virtual Desktop environment using PowerShell and Azure CLI. Given that several properties and different configurations are possible, I divided the information in 2 articles.
A first article will demonstrate how to configure the RDP properties for Audio and Video Redirection, and a second post will show you how to setup RDP properties for local devices and resources redirection. OK, let’s go.

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.

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.

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:

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.

Define RDP properties for AV redirection

To set a custom RDP property, you should use the Update-AzWvdHostPool cmdlet.

Microphone redirection

This setting determines how sounds captured (recorded) on the local computer are handled when connected to the remote computer. These are the accepted values.

  • audiocapturemode:i:0 – Disable audio capture from the local device.

  • audiocapturemode:i:1 – Enable audio capture from the local device and redirection to an audio application in the remote session.

Redirect video encoding

This setting enables or disables redirected video encoding. These are the accepted values.
  • encode redirected video capture:i:0 – Disable encoding of redirected video.
  • encode redirected video capture:i:1 – Enable encoding of redirected video.

Encoded video quality

This setting controls the quality of the encoded video. These are the accepted values.

  • quality:i:0 – High compression video.
  • quality:i:1 – Medium compression video.
  • quality:i:2 – Low compression video with high picture quality.

Audio output location

This setting determines how sounds captured (recorded) on the local computer are handled when you are connected to the remote computer. These are the accepted values.
  • audiomode:i:0 – Play sounds on the local computer
  • audiomode:i:1 -Play sounds on the remote computer.
  • audiomode:i:2 -Do not play sounds.

Define multiple custom RDP properties

To set multiple custom RDP properties, you should use the Update-AzWvdHostPool cmdlet with the following syntax.

And verify your changes with the Get-AzWvdHostPool cmdlet.

Get-AzWvdHostPool

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.

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.

Define RDP properties for AV redirection

To set a custom RDP property, you should use the following command.

Microphone redirection

This setting determines how sounds captured (recorded) on the local computer are handled when connected to the remote computer. These are the accepted values.
  • audiocapturemode:i:0 – Disable audio capture from the local device.
  • audiocapturemode:i:1 – Enable audio capture from the local device and redirection to an audio application in the remote session

Redirect video encoding

This setting enables or disables redirected video encoding. These are the accepted values.
  • encode redirected video capture:i:0 – Disable encoding of redirected video.
  • encode redirected video capture:i:1 – Enable encoding of redirected video

Encoded video quality

This setting controls the quality of the encoded video. These are the accepted values.
  • quality:i:0 – High compression video.
  • quality:i:1 – Medium compression video.
  • quality:i:2 – Low compression video with high picture quality.

Audio output location

This setting determines how sounds captured (recorded) on the local computer are handled when you are connected to the remote computer. These are the accepted values.
  • audiomode:i:0 – Play sounds on the local computer.
  • audiomode:i:1 -Play sounds on the remote computer.
  • audiomode:i:2 -Do not play sounds.

Define multiple custom RDP properties

To set multiple custom RDP properties, you should use the following command.

And verify your changes with the following command.

AV redirection

Reset all custom RDP properties

If you want to reset all custom RDP properties, you should use the following command.

Thanks for reading my post. I hope you find it helpful.

In the following article, I’ll explain how to configure RDP properties for a Host Pool – Device redirection.

Check out this link to learn more about Configuring Device redirections.