Skip to content

Commit 2eb7c64

Browse files
Merge pull request #229417 from Heidilohr/work-friendly-fixes
Fixing lost comments.
2 parents eec3143 + 197ea53 commit 2eb7c64

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

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

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Azure Virtual Desktop personal desktop assignment type - 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: 03/02/2023
6+
ms.date: 03/03/2023
77
ms.author: helohr
88
ms.custom: devx-track-azurepowershell
99
manager: femila
@@ -24,14 +24,14 @@ This article assumes you've already downloaded and installed the Azure Virtual D
2424

2525
### Define variables
2626

27-
The PowerShell commands listed in this article require defining the following variables:
27+
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:
2828

2929
```powershell
3030
#Define variables
31-
$subscriptionId = '00000000-0000-0000-0000-000000000000'
32-
$resourceGroupName = 'MyResourceGroupName'
33-
$hostPoolName = 'MyHostPoolName'
34-
$sessionHostName = 'SessionHostName'
31+
$subscriptionId = <00000000-0000-0000-0000-000000000000>
32+
$resourceGroupName = <MyResourceGroupName>
33+
$hostPoolName = <MyHostPoolName>
34+
$sessionHostName = <SessionHostName>
3535
```
3636

3737
## Personal host pools overview
@@ -49,13 +49,13 @@ To automatically assign users, first assign them to the personal desktop host po
4949
To configure a host pool to automatically assign users to VMs, run the following PowerShell cmdlet:
5050

5151
```powershell
52-
Update-AzWvdHostPool -ResourceGroupName <resourcegroupname> -Name <hostpoolname> -PersonalDesktopAssignmentType Automatic
52+
Update-AzWvdHostPool -ResourceGroupName $resourceGroupName -Name $hostPoolName -PersonalDesktopAssignmentType Automatic
5353
```
5454

5555
To assign a user to the personal desktop host pool, run the following PowerShell cmdlet:
5656

5757
```powershell
58-
New-AzRoleAssignment -SignInName <userupn> -RoleDefinitionName "Desktop Virtualization User" -ResourceName <appgroupname> -ResourceGroupName <resourcegroupname> -ResourceType 'Microsoft.DesktopVirtualization/applicationGroups'
58+
New-AzRoleAssignment -SignInName <userupn> -RoleDefinitionName "Desktop Virtualization User" -ResourceName <appgroupname> -ResourceGroupName $resourceGroupName -ResourceType 'Microsoft.DesktopVirtualization/applicationGroups'
5959
```
6060

6161
## Configure direct assignment
@@ -65,19 +65,19 @@ Unlike automatic assignment, when you use direct assignment, you must assign the
6565
To configure a host pool to require direct assignment of users to session hosts, run the following PowerShell cmdlet:
6666

6767
```powershell
68-
Update-AzWvdHostPool -ResourceGroupName <resourcegroupname> -Name <hostpoolname> -PersonalDesktopAssignmentType Direct
68+
Update-AzWvdHostPool -ResourceGroupName $resourceGroupName -Name $hostPoolName -PersonalDesktopAssignmentType Direct
6969
```
7070

7171
To assign a user to the personal desktop host pool, run the following PowerShell cmdlet:
7272

7373
```powershell
74-
New-AzRoleAssignment -SignInName <userupn> -RoleDefinitionName "Desktop Virtualization User" -ResourceName <appgroupname> -ResourceGroupName <resourcegroupname> -ResourceType 'Microsoft.DesktopVirtualization/applicationGroups'
74+
New-AzRoleAssignment -SignInName <userupn> -RoleDefinitionName "Desktop Virtualization User" -ResourceName <appgroupname> -ResourceGroupName $resourceGroupName -ResourceType 'Microsoft.DesktopVirtualization/applicationGroups'
7575
```
7676

7777
To assign a user to a specific session host, run the following PowerShell cmdlet:
7878

7979
```powershell
80-
Update-AzWvdSessionHost -HostPoolName <hostpoolname> -Name <sessionhostname> -ResourceGroupName <resourcegroupname> -AssignedUser <userupn>
80+
Update-AzWvdSessionHost -HostPoolName $hostPoolName -Name $sessionHostName -ResourceGroupName $resourceGroupName -AssignedUser <userupn>
8181
```
8282

8383
To directly assign a user to a session host in the Azure portal:
@@ -153,25 +153,31 @@ To reassign a personal desktop in the Azure portal:
153153

154154
## Reassign a personal desktop using PowerShell
155155

156+
Before you start, first define the `$reassignUserUpn` variable by running the following command:
157+
158+
```powershell
159+
$reassignUserUpn = <UPN of user you are reassigning the desktop to>
160+
```
161+
156162
To reassign a personal desktop, run this command:
157163

158164
```powershell
159165
$reassignDesktopParams = @{
160166
Path = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DesktopVirtualization/hostPools/$hostPoolName/sessionHosts/$($sessionHostName)?api-version=2022-02-10-preview&force=true"
161167
Payload = @{
162168
properties = @{
163-
assigneduser = 'UPN of new user'
169+
assigneduser = $reassignUserUpn
164170
}} | ConvertTo-Json
165171
Method = 'PATCH'
166172
}
167173
Invoke-AzRestMethod @reassignDesktopParams
168174
```
169175

170-
## Give session hosts within a personal host pools a friendly name
176+
## Give session hosts in a personal host pool a friendly name
171177

172178
You can give personal desktops you create *friendly names* to help users distinguish them in their feeds.
173179

174-
To give a host pool a friendly name, run the following command in PowerShell:
180+
To give a session host a friendly name, run the following command in PowerShell:
175181

176182
```powershell
177183
$body = '{ "properties": {
@@ -180,7 +186,7 @@ $body = '{ "properties": {
180186
181187
$parameters = @{
182188
Method = 'Patch'
183-
Path = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DesktopVirtualization/hostPools/$hostPoolName?api-version=2022-02-10-preview"
189+
Path = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DesktopVirtualization/hostPools/$hostPoolName/sessionHosts/$($sessionHostName)?api-version=2022-02-10-preview"
184190
Payload = $body
185191
}
186192
@@ -192,7 +198,7 @@ Invoke-AzRestMethod @parameters
192198
193199
### Get the session host friendly name
194200

195-
To get the session host friendly name, run this command in PowerShell
201+
To get the session host friendly name, run this command in PowerShell:
196202

197203
```powershell
198204
$getParams = @{
@@ -204,7 +210,7 @@ Invoke-AzRestMethod @getParams
204210

205211
## Next steps
206212

207-
Now that you've configured the personal desktop assignment type, you can sign in to an Azure Virtual Desktop client to test it as part of a user session. These articles will show you how to connect to a session using the client of your choice:
213+
Now that you've configured the personal desktop assignment type and given your session host a friendly name, you can sign in to an Azure Virtual Desktop client to test it as part of a user session. These articles will show you how to connect to a session using the client of your choice:
208214

209215
- [Connect with the Windows Desktop client](./users/connect-windows.md)
210216
- [Connect with the web client](./users/connect-web.md)

0 commit comments

Comments
 (0)