Assigning a personal desktop to a user involves associating a specific virtual machine with a user. In a pooled configuration, this is typically performed for persistence across sessions. This process can be achieved using the Azure portal, PowerShell module or Azure SDK.
Assigning through Azure Portal
Here are the steps to assign a personal desktop through the Azure portal.
- Open Azure portal and navigate to Azure Virtual Desktop.
- Click on the Host pool you wish to assign the personal desktop to.
- On the host pool’s page, select “Session Hosts” in the left menu.
- Select the Session Host you want to assign to the user.
- Click on the “Assign user” from the top menu.
- On the “Assign user” blade, search and select the user to assign, then click “Assign”.
Assigning through PowerShell
To assign a personal desktop to a user using the PowerShell command, use the New-AzWvdUserSessionHost
cmdlet. The example syntax would be:
New-AzWvdUserSessionHost -HostPoolName “myHostPool” -ResourceGroupName “myResourceGroup” -Name “myVM” -UserPrincipalName “user@contoso.com”
Assigning through Azure SDK
The Azure SDK also supports the assignment of personal desktops to users in the Azure Virtual Desktop environment. Further documentation on this can be found on the Microsoft API reference site.
Unassigning a Personal Desktop from a User in Azure Virtual Desktop
Unassigning a personal desktop from a user involves removing the virtual machine associated with a user. This can be handy when managing resources or when a user does not require a personal desktop anymore.
Unassigning through Azure Portal
Here are the steps to unassign a personal desktop through the Azure portal.
- Open Azure Portal and Navigate to Azure Virtual Desktop.
- Click on the Host pool you wish to unassign the personal desktop from.
- On the host pool’s page, select ”Session Host” in the left menu.
- Select the Session Host you want to unassign from the user.
- Next, click “Unassign user” from the top menu.
Unassigning through PowerShell
To unassign a personal desktop from a user using the PowerShell command, use the Remove-AzWvdUserSessionHost
cmdlet. The example syntax would be:
Remove-AzWvdUserSessionHost -HostPoolName “myHostPool” -ResourceGroupName “myResourceGroup” -Name “myVM” -UserPrincipalName “user@contoso.com”
Unassigning through Azure SDK
Azure SDK also provides the capability of unassigning a personal desktop. Further documentation about this procedure can be found on the Microsoft API reference site.
The capabilities of assigning and unassigning personal desktops provide flexible resource management in the Azure Virtual Desktop setup. This helps administrators control user-resources allocation. The flexibility to use the Azure portal, PowerShell, or SDK provides various ways to perform these actions depending on your preferences.
Practice Test
True or False: You can assign a personal desktop to multiple users in Azure Virtual Desktop.
- Answer: False
Explanation: In Azure Virtual Desktop, personal desktops are designed to be assigned to a single user only. Each user gets their own dedicated desktop that they can customize.
In Microsoft Azure Virtual Desktop, when you unassign a personal desktop, the desktop gets deleted.
- Answer: True
Explanation: When you unassign a personal desktop from a user, the personal desktop and all data on it gets deleted. The user’s personal data won’t be kept unless they’re stored in a redirected folder or OneDrive for Business.
Personal desktops can be manually assigned to users through Azure portal.
- Answer: True
Explanation: In Azure Virtual Desktop, you can manually assign personal desktops to users through the Azure portal.
Single select: Which PowerShell cmdlet can be used to assign a personal desktop to a user in Azure Virtual Desktop?
- A. New-AzWvdDesktop
- B. Set-AzWvdDesktop
- C. Assign-AzWvdDesktop
- D. Grant-AzWvdDesktop
Answer: B. Set-AzWvdDesktop
Explanation: The Set-AzWvdDesktop cmdlet assigns a personal desktop to a user or changes the properties of an existing personal desktop in Azure Virtual Desktop.
True or False: You can pre-allocate personal desktops to users in Microsoft Azure Virtual Desktop.
- Answer: False
Explanation: It is not possible to pre-allocate personal desktops in Azure Virtual Desktop. Assignments are made on a one-to-one basis.
Single select: Which of the following is a way to unassign a personal desktop in Azure Virtual Desktop through the Azure portal?
- A. Delete the user
- B. Delete the desktop
- C. Edit the desktop properties
- D. All of the above
Answer: D. All of the above
Explanation: You can unassign a personal desktop through the Azure portal by either deleting the user, the personal desktop, or by editing the desktop properties and removing the assigned user.
Multiple select: Using PowerShell and Azure portal are the ways to assign/unassign personal desktops in Azure Virtual Desktop.
- A. True
- B. False
Answer: A. True
Explanation: Both Azure portal and PowerShell can be used to assign and unassign personal desktops in Azure Virtual Desktop.
True or False: You can assign a user to more than one personal desktop.
- Answer: False
Explanation: A user can only be assigned to one personal desktop. The objective is to give each user a consistent and dedicated workspace.
Single Select: Which PowerShell cmdlet helps in unassigning a personal desktop from a user?
- A. Set-AzWvdDesktop
- B. Remove-AzWvdDesktop
- C. Delete-AzWvdDesktop
- D. UnSet-AzWvdDesktop
Answer: A. Set-AzWvdDesktop
Explanation: The Set-AzWvdDesktop cmdlet is used to remove an assignment of a personal desktop from a user in Azure Virtual Desktop.
Personal desktops in Azure Virtual Desktop are part of a pool and distributed randomly to users.
- Answer: False
Explanation: Personal desktops are assigned individually to a specific user. They are not part of a random distribution pool. Pool-based distribution applies to pooled (shared) desktops.
Interview Questions
How can you assign a personal desktop to a user in Azure?
You can assign a personal desktop to a user by navigating to the Azure portal, going to Azure Virtual Desktop, selecting Host pools, choosing the desired host pool, selecting Application groups and then choosing Add. From there, you can select the users you wish to assign the desktop to.
What PowerShell cmdlet can be used to assign personal desktops to users in Azure?
The
New-AzWvdApplicationGroup
cmdlet can be used to assign personal desktops to users in Azure.
How can you unassign a personal desktop from a user in Azure?
You can unassign a personal desktop from a user by going to the Azure portal, navigating to Azure Virtual Desktop, selecting Host pools, choosing the relevant host pool, selecting Application groups, and removing the desired user.
How can you validate whether a user has been successfully assigned a personal desktop?
You can validate this within the Azure portal. Simply navigate to Azure Virtual Desktop, select User sessions under the relevant host pool, and verify that the user in question is listed.
What type of licensing is required for the Azure Virtual Desktop?
Azure Virtual Desktop requires either a Microsoft 365 E3/E5, Microsoft 365 A3/A5/Student Use Benefits, or Windows 10 Enterprise E3/E5 license per user.
Where can you find the list of users who have been assigned a personal desktop?
You can find this list in the Azure portal by going to Azure Virtual Desktop, choosing the appropriate host pool, and then selecting Application groups.
What type of administrative role is needed to assign or unassign personal desktops to users in Azure?
The Global Administrator or WVD Service Owner roles are needed to assign or unassign personal desktops to users in Azure.
Can you assign a user to more than one personal desktop?
Azure currently does not support assigning a user to more than one personal desktop. Each user can be assigned to one desktop only.
Can you assign a group of users to a personal desktop?
No, personal desktop assignment in Azure Virtual Desktop is user-specific and does not support group assignment.
How does Azure assign a user to a personal desktop when using Depth-first load balancing?
When using Depth-first load balancing, Azure assigns users to the host with the highest number of connections, up to its maximum session limit.