|
| 1 | +--- |
| 2 | +title: Configure the session lock behavior for Azure Virtual Desktop |
| 3 | +description: Learn how to configure session lock behavior for Azure Virtual Desktop. |
| 4 | +ms.topic: how-to |
| 5 | +author: dknappettmsft |
| 6 | +ms.author: daknappe |
| 7 | +ms.date: 09/02/2024 |
| 8 | +--- |
| 9 | + |
| 10 | +# Configure the session lock behavior for Azure Virtual Desktop |
| 11 | + |
| 12 | +You can choose whether the session is disconnected or the remote lock screen shown when a remote session is locked, either by the user or by policy. When the session lock behavior is set to disconnect, a dialog is shown to let users know they were disconnected. Users can choose the **Reconnect** option from the dialog when they're ready to connect again. |
| 13 | + |
| 14 | +When used with single sign-on using Microsoft Entra ID, disconnecting the session provides the following benefits: |
| 15 | + |
| 16 | +- A consistent sign-in experience through Microsoft Entra ID when needed. |
| 17 | + |
| 18 | +- A single sign-on experience and reconnection without authentication prompt, when allowed by conditional access policies. |
| 19 | + |
| 20 | +- Support for passwordless authentication like passkeys and FIDO2 devices, contrary to the remote lock screen. Disconnecting the session is necessary to ensure full support of passwordless authentication. |
| 21 | + |
| 22 | +- Conditional access policies, including multifactor authentication and sign-in frequency, are reevaluated when the user reconnects to their session. |
| 23 | + |
| 24 | +- You can require multifactor authentication to return to the session and prevent users from unlocking with a simple username and password. |
| 25 | + |
| 26 | +For scenarios that rely on legacy authentication, including NTLM, CredSSP, RDSTLS, TLS, and RDP basic authentication protocols, users are prompted to re-enter their credentials. |
| 27 | + |
| 28 | +The default session lock behavior is different depending on whether you're using single sign-on with Microsoft Entra ID or legacy authentication. The following table shows the default configuration for each scenario: |
| 29 | + |
| 30 | +| Scenario | Default configuration | |
| 31 | +|--|--| |
| 32 | +| Single sign-on using Microsoft Entra ID | Disconnect the session | |
| 33 | +| Legacy authentication protocols | Show the remote lock screen | |
| 34 | + |
| 35 | +This article shows you how to change the session lock behavior from its default configuration using Microsoft Intune or Group Policy. |
| 36 | + |
| 37 | +## Prerequisites |
| 38 | + |
| 39 | +Select the relevant tab for your configuration method. |
| 40 | + |
| 41 | +# [Intune](#tab/intune) |
| 42 | + |
| 43 | +Before you can configure the session lock behavior, you need to meet the following prerequisites: |
| 44 | + |
| 45 | +- An existing host pool with session hosts. |
| 46 | + |
| 47 | +- Your session hosts must be running one of the following operating systems with the relevant cumulative update installed: |
| 48 | + |
| 49 | + - Windows 11 single or multi-session with the [2024-05 Cumulative Updates for Windows 11 (KB5037770)](https://support.microsoft.com/kb/KB5037770) or later installed. |
| 50 | + - Windows 10 single or multi-session, versions 21H2 or later with the [2024-06 Cumulative Updates for Windows 10 (KB5039211)](https://support.microsoft.com/kb/KB5039211) or later installed. |
| 51 | + - Windows Server 2022 with the [2024-05 Cumulative Update for Microsoft server operating system (KB5037782)](https://support.microsoft.com/kb/KB5037782) or later installed. |
| 52 | + |
| 53 | +- To configure Intune, you need: |
| 54 | + |
| 55 | + - A Microsoft Entra ID account that is assigned the [Policy and Profile manager](/mem/intune/fundamentals/role-based-access-control-reference#policy-and-profile-manager) built-in RBAC role. |
| 56 | + - A group containing the devices you want to configure. |
| 57 | + |
| 58 | +# [Group Policy](#tab/group-policy) |
| 59 | + |
| 60 | +Before you can configure the session lock behavior, you need to meet the following prerequisites: |
| 61 | + |
| 62 | +- An existing host pool with session hosts. |
| 63 | + |
| 64 | +- Your session hosts must be running one of the following operating systems with the relevant cumulative update installed: |
| 65 | + |
| 66 | + - Windows 11 single or multi-session with the [2024-05 Cumulative Updates for Windows 11 (KB5037770)](https://support.microsoft.com/kb/KB5037770) or later installed. |
| 67 | + - Windows 10 single or multi-session, versions 21H2 or later with the [2024-06 Cumulative Updates for Windows 10 (KB5039211)](https://support.microsoft.com/kb/KB5039211) or later installed. |
| 68 | + - Windows Server 2022 with the [2024-05 Cumulative Update for Microsoft server operating system (KB5037782)](https://support.microsoft.com/kb/KB5037782) or later installed. |
| 69 | + |
| 70 | +- To configure Group Policy, you need: |
| 71 | + |
| 72 | + - A domain account that has permission to create or edit Group Policy objects. |
| 73 | + - A security group or organizational unit (OU) containing the devices you want to configure. |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## Configure the session lock behavior |
| 78 | + |
| 79 | +Select the relevant tab for your configuration method. |
| 80 | + |
| 81 | +# [Intune](#tab/intune) |
| 82 | + |
| 83 | +To configure the session lock experience using Intune: |
| 84 | + |
| 85 | +1. Sign in to the [Microsoft Intune admin center](https://endpoint.microsoft.com/). |
| 86 | + |
| 87 | +1. [Create or edit a configuration profile](/mem/intune/configuration/administrative-templates-windows) for **Windows 10 and later** devices, with the **Settings catalog** profile type. |
| 88 | + |
| 89 | +1. In the settings picker, browse to **Administrative templates** > **Windows Components** > **Remote Desktop Services** > **Remote Desktop Session Host** > **Security**. |
| 90 | + |
| 91 | + :::image type="content" source="media/configure-session-lock-behavior/remote-desktop-session-host-security-intune.png" alt-text="A screenshot showing the Remote Desktop Session Host security options in the Microsoft Intune portal." lightbox="media/configure-session-lock-behavior/remote-desktop-session-host-security-intune.png"::: |
| 92 | + |
| 93 | +1. Check the box for one of the following settings, depending on your requirements: |
| 94 | + |
| 95 | + - For single sign-on using Microsoft Entra ID: |
| 96 | + |
| 97 | + 1. Check the box for **Disconnect remote session on lock for Microsoft identity platform authentication**, then close the settings picker. |
| 98 | + |
| 99 | + 1. Expand the **Administrative templates** category, then toggle the switch for **Disconnect remote session on lock for Microsoft identity platform authentication** to **Enabled** or **Disabled**: |
| 100 | + |
| 101 | + - To disconnect the remote session when the session locks, toggle the switch to **Enabled**, then select **OK**. |
| 102 | + |
| 103 | + - To show the remote lock screen when the session locks, toggle the switch to **Disabled**, then select **OK**. |
| 104 | + |
| 105 | + - For legacy authentication protocols: |
| 106 | + |
| 107 | + 1. Check the box for **Disconnect remote session on lock for legacy authentication**, then close the settings picker. |
| 108 | + |
| 109 | + 1. Expand the **Administrative templates** category, then toggle the switch for **Disconnect remote session on lock for legacy authentication** to **Enabled** or **Disabled**: |
| 110 | + |
| 111 | + - To disconnect the remote session when the session locks, toggle the switch to **Enabled**, then select **OK**. |
| 112 | + |
| 113 | + - To show the remote lock screen when the session locks, toggle the switch to **Disabled**, then select **OK**. |
| 114 | + |
| 115 | +1. Select **Next**. |
| 116 | + |
| 117 | +1. *Optional*: On the **Scope tags** tab, select a scope tag to filter the profile. For more information about scope tags, see [Use role-based access control (RBAC) and scope tags for distributed IT](/mem/intune/fundamentals/scope-tags). |
| 118 | + |
| 119 | +1. On the **Assignments** tab, select the group containing the computers providing a remote session you want to configure, then select **Next**. |
| 120 | + |
| 121 | +1. On the **Review + create** tab, review the settings, then select **Create**. |
| 122 | + |
| 123 | +1. Once the policy applies to the session hosts, restart them for the settings to take effect. |
| 124 | + |
| 125 | +1. To test the configuration, connect to a remote session, then lock the remote session. Verify that the session either disconnects or the remote lock screen is shown, depending on your configuration. |
| 126 | + |
| 127 | +# [Group Policy](#tab/group-policy) |
| 128 | + |
| 129 | +To configure the session lock experience using Group Policy, follow these steps. |
| 130 | + |
| 131 | +1. The Group Policy settings are only available the operating systems listed in [Prerequisites](#prerequisites). To make them available on other versions of Windows Server, you need to copy the administrative template files `C:\Windows\PolicyDefinitions\terminalserver.admx` and `C:\Windows\PolicyDefinitions\en-US\terminalserver.adml` from a session host to the same location on your domain controllers or the [Group Policy Central Store](/troubleshoot/windows-client/group-policy/create-and-manage-central-store), depending on your environment. In the file path for `terminalserver.adml` replace `en-US` with the appropriate language code if you're using a different language. |
| 132 | + |
| 133 | +1. Open the **Group Policy Management** console on device you use to manage the Active Directory domain. |
| 134 | + |
| 135 | +1. Create or edit a policy that targets the computers providing a remote session you want to configure. |
| 136 | + |
| 137 | +1. Navigate to **Computer Configuration** > **Policies** > **Administrative Templates** > **Windows Components** > **Remote Desktop Services** > **Remote Desktop Session Host** > **Security**. |
| 138 | + |
| 139 | + :::image type="content" source="media/configure-session-lock-behavior/remote-desktop-session-host-security-group-policy.png" alt-text="A screenshot showing the Remote Desktop Session Host security options in the Group Policy editor." lightbox="media/configure-session-lock-behavior/remote-desktop-session-host-security-group-policy.png"::: |
| 140 | + |
| 141 | +1. Double-click one of the following policy settings, depending on your requirements: |
| 142 | + |
| 143 | + - For single sign-on using Microsoft Entra ID: |
| 144 | + |
| 145 | + 1. Double-click **Disconnect remote session on lock for Microsoft identity platform authentication** to open it. |
| 146 | + |
| 147 | + - To disconnect the remote session when the session locks, select **Enabled** or **Not configured**. |
| 148 | + |
| 149 | + - To show the remote lock screen when the session locks, select **Disabled**. |
| 150 | + |
| 151 | + 1. Select **OK**. |
| 152 | + |
| 153 | + - For legacy authentication protocols: |
| 154 | + |
| 155 | + 1. Double-click **Disconnect remote session on lock for legacy authentication** to open it. |
| 156 | + |
| 157 | + - To disconnect the remote session when the session locks, select **Enabled** or **Not configured**. |
| 158 | + |
| 159 | + - To show the remote lock screen when the session locks, select **Disabled**. |
| 160 | + |
| 161 | + 1. Select **OK**. |
| 162 | + |
| 163 | +1. Ensure the policy is applied to the session hosts, then restart them for the settings to take effect. |
| 164 | + |
| 165 | +1. To test the configuration, connect to a remote session, then lock the remote session. Verify that the session either disconnects or the remote lock screen is shown, depending on your configuration. |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## Related content |
| 170 | + |
| 171 | +- Learn how to [Configure single sign-on for Azure Virtual Desktop using Microsoft Entra ID](configure-single-sign-on.md). |
| 172 | + |
| 173 | +- Check out [In-session passwordless authentication](authentication.md#in-session-passwordless-authentication) to learn how to enable passwordless authentication. |
| 174 | + |
| 175 | +- For more information about Microsoft Entra Kerberos, see [Deep dive: How Microsoft Entra Kerberos works](https://techcommunity.microsoft.com/t5/itops-talk-blog/deep-dive-how-azure-ad-kerberos-works/ba-p/3070889) |
0 commit comments