Skip to content

Commit 7261f7e

Browse files
Merge pull request #264494 from sipastak/personal-desktop
Update personal desktop assignment
2 parents 45d13f6 + b00cf64 commit 7261f7e

File tree

3 files changed

+103
-68
lines changed

3 files changed

+103
-68
lines changed

articles/virtual-desktop/configure-host-pool-personal-desktop-assignment-type.md

Lines changed: 63 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Configure personal desktop assignment in Azure Virtual Desktop - Azure
33
description: How to configure automatic or direct assignment for an Azure Virtual Desktop personal desktop host pool.
44
author: Heidilohr
55
ms.topic: how-to
6-
ms.date: 05/04/2023
6+
ms.date: 01/31/2024
77
ms.author: helohr
88
ms.custom: devx-track-azurepowershell
99
---
@@ -12,7 +12,9 @@ ms.custom: devx-track-azurepowershell
1212
>[!IMPORTANT]
1313
>This content applies to Azure Virtual Desktop with Azure Resource Manager Azure Virtual Desktop objects. If you're using Azure Virtual Desktop (classic) without Azure Resource Manager objects, see [this article](./virtual-desktop-fall-2019/configure-host-pool-personal-desktop-assignment-type-2019.md).
1414
15-
You can configure the assignment type of your personal desktop host pool to adjust your Azure Virtual Desktop environment to better suit your needs. In this topic, we'll show you how to configure automatic or direct assignment for your users.
15+
A personal host pool is a type of host pool that has personal desktops. Personal desktops have one-to-one mapping, which means a single user can only be assigned to a single personal desktop. Every time the user signs in, their user session is directed to their assigned personal desktop session host. This host pool type is ideal for customers with resource-intensive workloads because user experience and session performance will improve if there's only one session on the session host. Another benefit of this host pool type is that user activities, files, and settings persist on the virtual machine operating system (VM OS) disk after the user signs out.
16+
17+
Users must be assigned to a personal desktop to start their session. You can configure the assignment type of your personal desktop host pool to adjust your Azure Virtual Desktop environment to better suit your needs. In this topic, we'll show you how to configure automatic or direct assignment for your users.
1618

1719
>[!NOTE]
1820
> The instructions in this article only apply to personal desktop host pools, not pooled host pools, since users in pooled host pools aren't assigned to specific session hosts.
@@ -27,24 +29,6 @@ If you're using either the Azure portal or PowerShell method, you'll need the fo
2729

2830
If you're assigning desktops with PowerShell, you'll need to [download and install the Azure Virtual Desktop PowerShell module](powershell-module.md) if you haven't already.
2931

30-
### Define variables
31-
32-
The PowerShell commands listed in this article require defining the following variables with the placeholder values replaced with the values relevant to your account and deployment:
33-
34-
```powershell
35-
#Define variables
36-
$subscriptionId = <00000000-0000-0000-0000-000000000000>
37-
$resourceGroupName = <MyResourceGroupName>
38-
$hostPoolName = <MyHostPoolName>
39-
$sessionHostName = <SessionHostName>
40-
```
41-
42-
## Personal host pools overview
43-
44-
A personal host pool is a type of host pool that has personal desktops. Personal desktops have one-to-one mapping, which means a single user can only be assigned to a single personal desktop. Every time the user signs in, their user session is directed to their assigned personal desktop session host. This host pool type is ideal for customers with resource-intensive workloads because user experience and session performance will improve if there's only one session on the session host. Another benefit of this host pool type is that user activities, files, and settings persist on the virtual machine operating system (VM OS) disk after the user signs out.
45-
46-
Users must be assigned to a personal desktop to start their session. There are two types of assignments in a personal host pool: automatic assignment and direct assignment.
47-
4832
## Configure automatic assignment
4933

5034
Automatic assignment assigns users a personal desktop the first time they connect. It's the default assignment type for new personal desktop host pools you create in your Azure Virtual Desktop environment. Automatically assigning users doesn't require a specific session host.
@@ -69,14 +53,29 @@ To configure automatic assignment in the Azure portal:
6953

7054
Here's how to configure a host pool to automatically assign users to VMs using the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module.
7155

72-
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
56+
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
7357

7458
2. Run the `Update-AzWvdHostPool` command in the following example to configure a host pool to automatically assign users to VMs. For more information about the parameters,see the [az-desktopvirtualization-hostpool Azure CLI reference](/cli/azure/desktopvirtualization/hostpool).
7559

7660
```powershell
7761
Update-AzWvdHostPool -ResourceGroupName $resourceGroupName -Name $hostPoolName -PersonalDesktopAssignmentType Automatic
7862
```
7963

64+
#### [Azure CLI](#tab/cli)
65+
66+
Here's how to configure a host pool to automatically assign users to VMs using the [az-desktopvirtualization-hostpool-update](/cli/azure/desktopvirtualization/hostpool#az-desktopvirtualization-hostpool-update) command.
67+
68+
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
69+
70+
2. Run the command in the following example to configure a host pool to automatically assign users to VMs. For more information about the parameters, see the [az-desktopvirtualization-hostpool Azure CLI reference](/cli/azure/desktopvirtualization/hostpool).
71+
72+
```azurecli
73+
az desktopvirtualization hostpool update \
74+
--resource-group $resourceGroupName \
75+
--name $hostPoolName \
76+
--personal-desktop-assignment-type Automatic
77+
```
78+
8079
---
8180

8281
## Configure direct assignment
@@ -101,19 +100,36 @@ To configure direct assignment in the Azure portal:
101100

102101
Here's how to configure a host pool to require direct assignment of users to session hosts using the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module.
103102

104-
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
103+
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
105104

106-
2. Run the `Update-AzWvdHostPool` command in the following example to configure a host pool to require direct assignment. For more information about the parameters,see the [az-desktopvirtualization-hostpool Azure CLI reference](/cli/azure/desktopvirtualization/hostpool).
105+
2. Run the `Update-AzWvdHostPool` command in the following example to configure a host pool to require direct assignment. For more information about the parameters, see the [Update-AzWvdHostPool](/powershell/module/az.desktopvirtualization/update-azwvdhostpool) reference.
107106

108107
```powershell
109108
Update-AzWvdHostPool -ResourceGroupName $resourceGroupName -Name $hostPoolName -PersonalDesktopAssignmentType Direct
110109
```
111110

111+
#### [Azure CLI](#tab/cli)
112+
113+
Here's how to configure a host pool to automatically assign users to VMs using the [az-desktopvirtualization-hostpool-update](/cli/azure/desktopvirtualization/hostpool#az-desktopvirtualization-hostpool-update) command.
114+
115+
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
116+
117+
2. Run the command in the following example to configure a host pool to automatically assign users to VMs. For more information about the parameters, see the [az-desktopvirtualization-hostpool Azure CLI reference](/cli/azure/desktopvirtualization/hostpool).
118+
119+
```azurecli
120+
az desktopvirtualization hostpool update \
121+
--resource-group $resourceGroupName \
122+
--name $hostPoolName \
123+
--personal-desktop-assignment-type Direct
124+
```
125+
112126
---
113127

114128
### Directly assign users to session hosts
115129

116-
#### [Azure portal](#tab/azure)
130+
Here's how to directly assign users to session hosts using the Azure portal or PowerShell. You can't assign users to session hosts using Azure CLI.
131+
132+
#### [Azure portal](#tab/azure2)
117133

118134
To directly assign a user to a session host in the Azure portal:
119135

@@ -141,22 +157,26 @@ To directly assign a user to a session host in the Azure portal:
141157

142158
1. When you're done, select **Select**.
143159

144-
#### [PowerShell](#tab/powershell)
160+
#### [PowerShell](#tab/powershell2)
145161

146162
Here's how to configure a host pool to assign a user to a specific session host using the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module.
147163

148-
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
164+
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
149165

150-
2. Run the `Update-AzWvdHostPool` command in the following example to assign a user to a session host. For more information about the parameters,see the [az-desktopvirtualization-hostpool Azure CLI reference](/cli/azure/desktopvirtualization/hostpool).
166+
2. Run the `Update-AzWvdHostPool` command in the following example to assign a user to a session host. For more information about the parameters, see the [Update-AzWvdHostPool](/powershell/module/az.desktopvirtualization/update-azwvdhostpool) reference.
151167

152168
```powershell
153-
Update-AzWvdSessionHost -HostPoolName $hostPoolName -Name $sessionHostName -ResourceGroupName $resourceGroupName -AssignedUser <userupn>
169+
Update-AzWvdSessionHost -HostPoolName $hostPoolName -Name $sessionHostName -ResourceGroupName $resourceGroupName -AssignedUser $userupn
154170
```
171+
172+
155173
---
156174

157175
## Unassign a personal desktop
158176

159-
#### [Azure portal](#tab/azure)
177+
Here's how to unassign a personal desktop using the Azure portal or PowerShell. You can't unassign a personal desktop using Azure CLI.
178+
179+
#### [Azure portal](#tab/azure2)
160180

161181
To unassign a personal desktop in the Azure portal:
162182

@@ -182,13 +202,13 @@ To unassign a personal desktop in the Azure portal:
182202
183203
1. Select **Unassign** when prompted with the warning.
184204

185-
#### [PowerShell](#tab/powershell)
205+
#### [PowerShell](#tab/powershell2)
186206

187207
Here's how to configure a host pool to unassign a personal desktop using the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module.
188208

189-
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
209+
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
190210

191-
2. Run the `Invoke-AzRestMethod` command in the following example to unassign a personal desktop. For more information about the parameters,see the [az-desktopvirtualization-hostpool Azure CLI reference](/cli/azure/desktopvirtualization/hostpool).
211+
2. Run the `Invoke-AzRestMethod` command in the following example to unassign a personal desktop. For more information about the parameters, see the [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) reference.
192212

193213
```powershell
194214
$unassignDesktopParams = @{
@@ -201,11 +221,15 @@ Here's how to configure a host pool to unassign a personal desktop using the [Az
201221
}
202222
Invoke-AzRestMethod @unassignDesktopParams
203223
```
224+
225+
204226
---
205227

206228
## Reassign a personal desktop
207229

208-
#### [Azure portal](#tab/azure)
230+
Here's how to reassign a personal desktop using the Azure portal or PowerShell. You can't reassign a personal desktop using Azure CLI.
231+
232+
#### [Azure portal](#tab/azure2)
209233

210234
To reassign a personal desktop in the Azure portal:
211235

@@ -232,19 +256,19 @@ To reassign a personal desktop in the Azure portal:
232256

233257
1. When you're done, select **Select**.
234258

235-
#### [PowerShell](#tab/powershell)
259+
#### [PowerShell](#tab/powershell2)
236260

237261
Here's how to reassign a personal desktop using the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module.
238262

239-
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
263+
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
240264

241265
2. Run the following command to define the `$reassignUserUpn` variable by running the following command:
242266

243267
```powershell
244268
$reassignUserUpn = <UPN of user you are reassigning the desktop to>
245269
```
246270

247-
3. Run the `Invoke-AzRestMethod` command in the following example to reassign a personal desktop. For more information about the parameters,see the [az-desktopvirtualization-hostpool Azure CLI reference](/cli/azure/desktopvirtualization/hostpool).
271+
3. Run the `Invoke-AzRestMethod` command in the following example to reassign a personal desktop. For more information about the parameters, see the [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) reference.
248272

249273
```powershell
250274
$reassignDesktopParams = @{
@@ -258,42 +282,15 @@ Here's how to reassign a personal desktop using the [Az.DesktopVirtualization](/
258282
Invoke-AzRestMethod @reassignDesktopParams
259283
```
260284

285+
261286
---
262287

263288
## Give session hosts in a personal host pool a friendly name
264289

265-
You can give personal desktops you create *friendly names* to help users distinguish them in their feeds. You need a [REST API](/rest/api/desktopvirtualization/session-hosts/update?tabs=HTTP) to configure the friendly name.
266-
267-
Run the following command in PowerShell to use the REST API to give your session host a friendly name:
268-
269-
```powershell
270-
$body = '{ "properties": {
271-
"friendlyName": "friendlyName"
272-
} }'
273-
$parameters = @{
274-
Method = 'Patch'
275-
Path = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DesktopVirtualization/hostPools/$hostPoolName/sessionHosts/$($sessionHostName)?api-version=2022-02-10-preview"
276-
Payload = $body
277-
}
278-
279-
Invoke-AzRestMethod @parameters
280-
```
281-
282-
The Azure portal doesn't currently have a way to give session host friendly names.
283-
284-
### Get the session host friendly name
285-
286-
To get the session host friendly name, run the following command in PowerShell:
290+
You can give personal desktops you create *friendly names* to help users distinguish them in their feeds using PowerShell. The Azure portal or Azure CLI doesn't currently have a way to give session host friendly names.
287291

288-
```powershell
289-
$getParams = @{
290-
Path = '/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DesktopVirtualization/hostPools/$hostPoolName/sessionHosts/$($sessionHostName)?api-version=2022-02-10-preview'
291-
Method = 'GET'
292-
}
293-
Invoke-AzRestMethod @getParams
294-
```
292+
[!INCLUDE [include-session-hosts-friendly-name](includes/include-session-hosts-friendly-name.md)]
295293

296-
There isn't currently a way to get the session host friendly name in the Azure portal.
297294

298295
## Next steps
299296

articles/virtual-desktop/customize-feed-for-virtual-desktop-users.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Customize feed for Azure Virtual Desktop users - Azure
33
description: How to customize feed for Azure Virtual Desktop users with PowerShell cmdlets.
44
author: Heidilohr
55
ms.topic: how-to
6-
ms.date: 08/16/2020
6+
ms.date: 02/01/2024
77
ms.author: helohr
88
ms.custom: devx-track-azurepowershell
99
---
@@ -25,7 +25,8 @@ You can change the display name for a remote desktop for your users by setting i
2525
>[!NOTE]
2626
>The following instructions only apply to personal desktops, not pooled desktops. Also, personal host pools only allow and support desktop application groups.
2727
28-
To add or change a session host's friendly name, use the [Session Host - Update REST API](/rest/api/desktopvirtualization/session-hosts/update?tabs=HTTP) and update the *properties.friendlyName* parameter with a REST API request.
28+
[!INCLUDE [include-session-hosts-friendly-name](includes/include-session-hosts-friendly-name.md)]
29+
2930

3031
## Customize the display name for a RemoteApp
3132

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
author: sipastak
3+
ms.author: sipastak
4+
ms.topic: include
5+
ms.date: 01/30/2024
6+
---
7+
8+
Run the following command in PowerShell to add or change a session host's friendly name:
9+
10+
```powershell
11+
$parameters = @{
12+
HostPoolName = 'HostPoolName'
13+
Name = 'SessionHostName'
14+
ResourceGroupName = 'ResourceGroupName'
15+
FriendlyName = 'SessionHostFriendlyName'
16+
}
17+
18+
Update-AzWvdSessionHost @parameters
19+
```
20+
21+
22+
23+
### Get the session host friendly name
24+
25+
To get the session host friendly name, run the following command in PowerShell:
26+
27+
```powershell
28+
$sessionHostParams = @{
29+
HostPoolName = 'HostPoolName'
30+
Name = 'SessionHostName'
31+
ResourceGroupName = 'ResourceGroupName'
32+
}
33+
34+
Get-AzWvdSessionHost @sessionHostParams | FL Name, AssignedUser, FriendlyName
35+
```
36+
37+
There isn't currently a way to get the session host friendly name in the Azure portal.

0 commit comments

Comments
 (0)