Skip to content

Commit 2b4ca00

Browse files
committed
Added CLI
1 parent d473458 commit 2b4ca00

File tree

3 files changed

+53
-120
lines changed

3 files changed

+53
-120
lines changed

articles/virtual-desktop/TOC.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@
394394
href: enroll-per-user-access-pricing.md
395395
- name: Host pools
396396
items:
397-
- name: Customize RDP properties
397+
- name: Set custom RDP properties
398+
displayName: customize
398399
href: customize-rdp-properties.md
399400
- name: Configure load balancing method
400401
displayName: load-balancing, lb

articles/virtual-desktop/customize-rdp-properties.md

Lines changed: 51 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Set custom RDP properties on a host pool in Azure Virtual Desktop
33
description: Learn how to set custom RDP properties on a host pool that add to the default properties and values or override the default values.
44
author: dknappettmsft
55
ms.topic: how-to
6-
ms.date: 08/21/2024
6+
ms.date: 08/22/2024
77
ms.author: daknappe
88
ms.custom: devx-track-azurepowershell, docs_inherited
99
---
@@ -44,7 +44,7 @@ Before you can set custom RDP properties on a host pool, you need:
4444

4545
- An existing host pool.
4646

47-
- An Azure account assigned the [Desktop Virtualization Host Pool Contributor](rbac.md#desktop-virtualization-host-pool-contributor) role.
47+
- An Azure account assigned the [Desktop Virtualization Host Pool Contributor](rbac.md#desktop-virtualization-host-pool-contributor) role or equivalent.
4848

4949
- If you want to use Azure CLI or Azure PowerShell locally, see [Use Azure CLI and Azure PowerShell with Azure Virtual Desktop](cli-powershell.md) to make sure you have the [desktopvirtualization](/cli/azure/desktopvirtualization) Azure CLI extension or the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module installed. Alternatively, use the [Azure Cloud Shell](../cloud-shell/overview.md).
5050

@@ -54,23 +54,25 @@ Select the relevant tab for your scenario.
5454

5555
### [Azure portal](#tab/portal)
5656

57-
To configure RDP properties using the Azure portal:
57+
Here's how to configure RDP properties using the Azure portal. For a full list of supported properties and values, see [Supported RDP properties with Azure Virtual Desktop](rdp-properties.md).
5858

5959
1. Sign in to the [Azure portal](https://portal.azure.com).
6060

61-
2. In the search bar, enter *Azure Virtual Desktop* and select the matching service entry.
61+
1. In the search bar, enter *Azure Virtual Desktop* and select the matching service entry.
6262

63-
4. Select **Host pools**, then select the name of the host pool you want to update.
63+
1. Select **Host pools**, then select the name of the host pool you want to update.
6464

65-
6. Select **RDP Properties**, then select the **Advanced** tab.
65+
1. Select **RDP Properties**, then select the **Advanced** tab.
6666

67-
7. Add or make your changes to the RDP properties in a semicolon-separated format, like the default values already shown.
67+
:::image type="content" source="media/customize-rdp-properties/rdp-properties-advanced.png" alt-text="A screenshot showing the advanced tab of RDP properties in the Azure portal.":::
6868

69-
8. When you're done, select **Save** to save your changes. Users need to refresh their resources to receive the changes.
69+
1. Add extra RDP properties or make changes to the existing RDP properties in a semicolon-separated format, like the default values already shown.
70+
71+
1. When you're done, select **Save** to save your changes. Users need to refresh their resources to receive the changes.
7072

7173
### [Azure PowerShell](#tab/powershell)
7274

73-
To configure RDP properties using Azure PowerShell, use the following examples. Be sure to change the `<placeholder>` values for your own. For a full list of supported properties and values, see [Supported RDP properties with Azure Virtual Desktop](rdp-properties.md)
75+
To configure RDP properties using Azure PowerShell, use the following examples. Be sure to change the `<placeholder>` values for your own. For a full list of supported properties and values, see [Supported RDP properties with Azure Virtual Desktop](rdp-properties.md).
7476

7577
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
7678

@@ -109,14 +111,11 @@ To configure RDP properties using Azure PowerShell, use the following examples.
109111
Update-AzWvdHostPool -Name $hostPool -ResourceGroupName $resourceGroup -CustomRdpProperty $customProperties
110112
```
111113
112-
113114
3. Check the custom RDP properties set on the same host pool by running the following command:
114115
115-
```azurepowershell
116-
117-
```powershell
118-
Get-AzWvdHostPool -ResourceGroupName $resourceGroup -Name $hostPool | FL Name, CustomRdpProperty
119-
```
116+
```azurepowershell
117+
Get-AzWvdHostPool -Name $hostPool -ResourceGroupName $resourceGroup | FT Name, CustomRdpProperty
118+
```
120119

121120
The output should be similar to the following example:
122121

@@ -125,149 +124,82 @@ To configure RDP properties using Azure PowerShell, use the following examples.
125124
CustomRdpProperty : use multimon:i:1;redirectclipboard:i:0;redirectprinters:i:0;
126125
```
127126

127+
4. Users need to refresh their resources to receive the changes.
128+
128129
### [Azure CLI](#tab/cli)
129130

130-
To configure RDP properties using Azure CLI, use the following examples. Be sure to change the `<placeholder>` values for your own. For a full list of supported properties and values, see [Supported RDP properties with Azure Virtual Desktop](rdp-properties.md)
131+
To configure RDP properties using Azure CLI, use the following examples. Be sure to change the `<placeholder>` values for your own. For a full list of supported properties and values, see [Supported RDP properties with Azure Virtual Desktop](rdp-properties.md).
131132

132133
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
133134

134135
2. Use one of the following examples based on your requirements:
135136

136-
- To add custom RDP properties to a host pool and keep any existing custom properties already set, run the following commands. RDP properties need to be written in a semi-colon-separated format. This example adds disabling clipboard and printer redirection:
137+
- To add custom RDP properties to a host pool and keep any existing custom properties already set, run the following commands. RDP properties need to be written in a semi-colon-separated format. This example adds disabling clipboard and printer redirection to the existing custom properties:
137138

138139
```azurecli
140+
hostPool="<HostPoolName>"
141+
resourceGroup="<ResourceGroupName>"
142+
addCustomProperties="redirectclipboard:i:0;redirectprinters:i:0"
143+
139144
currentCustomProperties=$(az desktopvirtualization hostpool show \
140-
--name <HostPoolName> \
141-
--resource-group <ResourceGroupName> \
145+
--name $hostPool \
146+
--resource-group $resourceGroup \
142147
--query [customRdpProperty] \
143148
--output tsv)
144149
145-
TODO: FINISH THIS
146-
147-
148-
$hostPool = "<HostPoolName>"
149-
$resourceGroup = "<ResourceGroupName>"
150-
$addCustomProperties = "redirectclipboard:i:0;redirectprinters:i:0"
151-
152-
$currentCustomProperties = (Get-AzWvdHostPool -Name $hostPool -ResourceGroupName $resourceGroup).CustomRdpProperty
153-
$customProperties = $currentCustomProperties + $addCustomProperties
154-
155-
Update-AzWvdHostPool -Name $hostPool -ResourceGroupName $resourceGroup -CustomRdpProperty $customProperties
156-
150+
customProperties="$currentCustomProperties$addCustomProperties"
157151
152+
az desktopvirtualization hostpool update \
153+
--name $hostPool \
154+
--resource-group $resourceGroup \
155+
--custom-rdp-property "$customProperties"
158156
```
159157
160158
- To replace all existing custom properties with a new set of custom RDP properties, run the following command. This example only sets disabling clipboard and printer redirection:
161159
162160
```azurecli
161+
hostPool="<HostPoolName>"
162+
resourceGroup="<ResourceGroupName>"
163+
163164
az desktopvirtualization hostpool update \
164-
--name <HostPoolName> \
165-
--resource-group <ResourceGroupName> \
165+
--name $hostPool \
166+
--resource-group $resourceGroup \
166167
--custom-rdp-property "redirectclipboard:i:0;redirectprinters:i:0"
167168
```
168169
169170
- To remove all custom RDP properties from a host pool, run the following command. This example passes an empty string to the `--custom-rdp-property` parameter:
170171
171172
```azurecli
173+
hostPool="<HostPoolName>"
174+
resourceGroup="<ResourceGroupName>"
175+
172176
az desktopvirtualization hostpool update \
173-
--name <HostPoolName> \
174-
--resource-group <ResourceGroupName> \
177+
--name $hostPool \
178+
--resource-group $resourceGroup \
175179
--custom-rdp-property ""
176180
```
177181
178-
179-
3. Check the custom RDP properties set on a host pool by running the following command:
180-
181-
```azurecli
182-
az desktopvirtualization hostpool show \
183-
--name <HostPoolName> \
184-
--resource-group <ResourceGroupName> \
185-
--query [customRdpProperty] \
186-
--output tsv
187-
```
188-
189-
The output should be similar to the following example:
190-
191-
```output
192-
Name : contoso-hp01
193-
CustomRdpProperty : use multimon:i:1;redirectclipboard:i:0;redirectprinters:i:0;
194-
```
195-
196-
197-
198-
199-
TODO: UPDATE ARTICLE FILENAME/TOC/REDIRECTION
200-
201-
202-
203-
204-
205-
206-
207-
208-
209-
210-
211-
212-
213-
214-
215-
216-
217-
To edit custom RDP properties manually in Azure CLI:
218-
219-
### Add or edit multiple custom RDP properties
220-
221-
To add or edit multiple custom RDP properties in Azure CLI:
222-
223-
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
224-
225-
2. Run the following cmdlets by providing the custom RDP property:
226-
227-
228-
```azurecli
229-
az desktopvirtualization hostpool update \
230-
--resource-group $resourceGroupName \
231-
--name $hostPoolName \
232-
--custom-rdp-property $rdpProperty
233-
```
234-
235-
3. You can check to make sure the RDP property was added by running the following cmdlet:
182+
3. Check the custom RDP properties set on the same host pool by running the following command:
236183
237184
```azurecli
238185
az desktopvirtualization hostpool show \
239-
--resource-group $resourceGroupName \
240-
--name $hostPoolName
241-
```
242-
243-
>[!IMPORTANT]
244-
>- A null CustomRdpProperty field will apply all default RDP properties to your host pool. An empty CustomRdpProperty field won't apply any default RDP properties to your host pool.
245-
246-
### Remove all RDP properties
247-
248-
To remove all custom RDP properties:
249-
250-
1. You can remove all custom RDP properties for a host pool by running the following Azure CLI cmdlet:
251-
252-
```azurecli
253-
az desktopvirtualization hostpool update \
254-
--resource-group $resourceGroupName \
255-
--name $hostPoolName \
256-
--custom-rdp-property ""
186+
--name $hostPool \
187+
--resource-group $resourceGroup \
188+
--query "{name:name, customRdpProperty:customRdpProperty}" \
189+
--output table
257190
```
258191
259-
2. To make sure you've successfully removed the setting, enter this cmdlet:
192+
The output should be similar to the following example:
260193
261-
```azurecli
262-
az desktopvirtualization hostpool show \
263-
--resource-group $resourceGroupName \
264-
--name $hostPoolName
194+
```output
195+
Name CustomRdpProperty
196+
-------- ------------------------------------------------------------
197+
contoso-hp01 use multimon:i:0;redirectclipboard:i:0;redirectprinters:i:0;
265198
```
266199
267-
268-
---
269-
200+
4. Users need to refresh their resources to receive the changes.
270201
271202
## Related content
272203
273204
- [Supported RDP properties with Azure Virtual Desktop](rdp-properties.md)
205+
- [Peripheral and resource redirection over the Remote Desktop Protocol](redirection-remote-desktop-protocol.md)
52.9 KB
Loading

0 commit comments

Comments
 (0)