Skip to content

Commit 197ea53

Browse files
committed
Updates based on feedback.
1 parent 9eda706 commit 197ea53

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ The PowerShell commands listed in this article require defining the following va
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,14 +153,20 @@ To reassign a personal desktop in the Azure portal:
153153

154154
## Reassign a personal desktop using PowerShell
155155

156-
To reassign a personal desktop, run this command with the placeholder values replaced with values relevant to your deployment:
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+
162+
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
}
@@ -171,7 +177,7 @@ Invoke-AzRestMethod @reassignDesktopParams
171177

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

174-
To give a session host a friendly name, run the following command in PowerShell with the placeholder values replaced with values relevant to your deployment:
180+
To give a session host a friendly name, run the following command in PowerShell:
175181

176182
```powershell
177183
$body = '{ "properties": {
@@ -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 with the placeholder values replaced with values relevant to your deployment:
201+
To get the session host friendly name, run this command in PowerShell:
196202

197203
```powershell
198204
$getParams = @{

0 commit comments

Comments
 (0)