You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-desktop/drain-mode.md
+50-11Lines changed: 50 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,45 +6,84 @@ author: Heidilohr
6
6
7
7
ms.service: virtual-desktop
8
8
ms.topic: how-to
9
-
ms.date: 04/14/2021
9
+
ms.date: 02/09/2024
10
10
ms.author: helohr
11
11
---
12
12
13
13
# Use drain mode to isolate session hosts and apply patches
14
14
15
15
Drain mode isolates a session host when you want to apply patches and do maintenance without disrupting user sessions. When isolated, the session host won't accept new user sessions. Any new connections will be redirected to the next available session host. Existing connections in the session host will keep working until the user signs out or the administrator ends the session. When the session host is in drain mode, admins can also remotely connect to the server without going through the Azure Virtual Desktop service. You can apply this setting to both pooled and personal desktops.
16
16
17
-
## Set drain mode using the Azure portal
17
+
## Prerequisites
18
+
19
+
If you're using either the Azure portal or PowerShell method, you'll need the following things:
20
+
21
+
- A host pool with at least one session host.
22
+
- An Azure account assigned the [Desktop Virtualization Session Host Operator](rbac.md#desktop-virtualization-session-host-operator) role.
23
+
- If you want to use Azure PowerShell locally, see [Use Azure CLI and Azure PowerShell with Azure Virtual Desktop](cli-powershell.md) to make sure you have the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module installed. Alternatively, use the [Azure Cloud Shell](../cloud-shell/overview.md).
24
+
25
+
26
+
## Enable drain mode
27
+
28
+
Here's how to enable drain mode using the Azure portal and PowerShell.
29
+
30
+
### [Portal](#tab/portal)
18
31
19
32
To turn on drain mode in the Azure portal:
20
33
21
-
1. Open the Azure portal and go to the host pool you want to isolate.
34
+
1. Sign in to the [Azure portal](https://portal.azure.com).
35
+
36
+
1. Enter **Azure Virtual Desktop** into the search bar.
22
37
23
-
2. In the navigation menu, select **Session hosts**.
38
+
1. Under **Services**, select **Azure Virtual Desktop**.
24
39
25
-
3. Next, select the hosts you want to turn on drain mode for, then select **Turn drain mode on**.
40
+
1. At the Azure Virtual Desktop page, go the menu on the left side of the window and select **Host pools**.
26
41
27
-
4. To turn off drain mode, select the host pools that have drain mode turned on, then select **Turn drain mode off**.
42
+
1. Select the host pool you want to isolate.
28
43
29
-
## Set drain mode using PowerShell
44
+
1. In the navigation menu, select **Session hosts**.
45
+
46
+
1. Next, select the hosts you want to turn on drain mode for, then select **Turn drain mode on**.
47
+
48
+
1. To turn off drain mode, select the host pools that have drain mode turned on, then select **Turn drain mode off**.
49
+
50
+
### [PowerShell](#tab/powershell)
30
51
31
52
You can set drain mode in PowerShell with the *AllowNewSessions* parameter, which is part of the [Update-AzWvdSessionhost](/powershell/module/az.desktopvirtualization/update-azwvdsessionhost) command.
>You'll need to run this command for every session host you're applying the setting to.
47
84
85
+
---
86
+
48
87
## Next steps
49
88
50
89
If you want to learn more about the Azure portal for Azure Virtual Desktop, check out [our tutorials](create-host-pools-azure-marketplace.md). If you're already familiar with the basics, check out some of the other features you can use with the Azure portal, such as [MSIX app attach](app-attach-azure-portal.md) and [Azure Advisor](../advisor/advisor-overview.md).
0 commit comments