|
1 | 1 | ---
|
2 | 2 | title: Drain session hosts for maintenance in Azure Virtual Desktop
|
3 |
| -description: Learn how to drain session hosts for maintenance in Azure Virtual Desktop. |
| 3 | +description: Learn how to enable drain mode to isolate session hosts for maintenance in Azure Virtual Desktop. |
4 | 4 | ms.topic: how-to
|
5 | 5 | author: dknappettmsft
|
6 | 6 | ms.author: daknappe
|
7 |
| -ms.date: 02/22/2024 |
| 7 | +ms.date: 02/23/2024 |
8 | 8 | ---
|
9 | 9 |
|
10 | 10 | # Drain session hosts for maintenance in Azure Virtual Desktop
|
@@ -45,37 +45,37 @@ To enable drain mode for a session host and block new sessions in the Azure port
|
45 | 45 |
|
46 | 46 | ### [Azure PowerShell](#tab/powershell)
|
47 | 47 |
|
48 |
| -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. |
| 48 | +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 these commands for every session host for which you want to enable and disable drain. |
| 49 | + |
| 50 | +> [!IMPORTANT] |
| 51 | +> In the following examples, you'll need to change the `<placeholder>` values for your own. |
49 | 52 |
|
50 | 53 | [!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
|
51 | 54 |
|
52 | 55 | 2. To enable drain for a session host and block new sessions, run the following command:
|
53 | 56 |
|
54 | 57 | ```powershell
|
55 | 58 | $params = @{
|
56 |
| - ResourceGroupName = '<resourceGroupName>' |
57 |
| - HostPoolName = '<hostpoolname>' |
58 |
| - Name = '<hostname>' |
| 59 | + ResourceGroupName = '<ResourceGroupName>' |
| 60 | + HostPoolName = '<HostPoolName>' |
| 61 | + Name = '<SessionHostName>' |
59 | 62 | AllowNewSession = $False
|
60 | 63 | }
|
61 | 64 |
|
62 | 65 | Update-AzWvdSessionHost @params
|
63 | 66 | ```
|
64 | 67 |
|
65 |
| -3. To disable drain for a session host and allow new sessions, run the following command: |
| 68 | +3. To disable drain for a session host and allow new sessions, run the following command: |
66 | 69 |
|
67 | 70 | ```powershell
|
68 | 71 | $params = @{
|
69 |
| - ResourceGroupName = '<resourceGroupName>' |
70 |
| - HostPoolName = '<hostpoolname>' |
71 |
| - Name = '<hostname>' |
| 72 | + ResourceGroupName = '<ResourceGroupName>' |
| 73 | + HostPoolName = '<HostPoolName>' |
| 74 | + Name = '<SessionHostName>' |
72 | 75 | AllowNewSession = $True
|
73 | 76 | }
|
74 | 77 |
|
75 | 78 | Update-AzWvdSessionHost @params
|
76 | 79 | ```
|
77 | 80 |
|
78 |
| -> [!IMPORTANT] |
79 |
| -> You'll need to run these commands for every session host for which you want to enable and disable drain. |
80 |
| -
|
81 | 81 | ---
|
0 commit comments