en-US windows computer

Disconnect remote session on lock for Microsoft identity platform authentication

Verified with Windows 11 25H2 — updated on July 30, 2026

Windows 11 25H2

Supported on: At least Windows Vista

Path in the GPO console

Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Security

Description

This policy setting allows you to configure the user experience when the Remote Desktop session is locked by the user or by a policy. You can specify whether the remote session will show the remote lock screen or disconnect when the remote session is locked. Disconnecting the remote session ensures that a remote session cannot be left on the lock screen and cannot reconnect automatically due to loss of network connectivity. This policy applies only when using an identity provider that uses the Microsoft identity platform, such as Microsoft Entra ID, to authenticate to the remote PC. This policy doesn't apply when using Legacy authentication which includes the NTLM, CredSSP, RDSTLS, TLS, and RDP basic authentication protocols. If you enable or do not configure this policy setting, Remote Desktop connections using the Microsoft identity platform will disconnect the remote session when the remote session is locked. Users can reconnect when they're ready and can use passwordless authentication if configured. If you disable this policy setting, Remote Desktop connections using the Microsoft identity platform will show the remote lock screen when the remote session is locked. Users can unlock the remote session using their username and password, or certificates.

Registry

HKLM SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services

Value name: fDisconnectOnLockMicrosoftIdentity

Enabled: fDisconnectOnLockMicrosoftIdentity = 1

Disabled: fDisconnectOnLockMicrosoftIdentity = 0

MDM / Intune (CSP)

./Device/Vendor/MSFT/Policy/Config/RemoteDesktopServices/DisconnectOnLockMicrosoftIdentityAuthn
Device Since [10.0.20348.2461] and later | [10.0.25398.887] and later | Windows 10, version 2004 [10.0.19041.4474] and later | Windows 11, version 21H2 with KB5037770 [10.0.22000.2960] and later | Windows 11, version 22H2 with KB5037771 [10.0.22621.3593] and later | Windows 11, version 24H2 [10.0.26100] and later Official mapping (Microsoft Learn)

Microsoft Learn documentation Mapping data: Microsoft Learn (CC BY 4.0)

Export Builder

BETA

Configure the state, scope and options, then generate .reg, PowerShell, Intune and SCCM outputs — or add the setting to a multi-setting collection.

These exports write the registry — this is not a managed GPO.

.reg file

Windows Registry Editor Version 5.00

; Exported from gporais.com
; Policy: Disconnect remote session on lock for Microsoft identity platform authentication
; State: Enabled
; Supported on: At least Windows Vista

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"fDisconnectOnLockMicrosoftIdentity"=dword:00000001
More formats (PowerShell, Intune, SCCM)

PowerShell

# Exported from gporais.com
# Policy: Disconnect remote session on lock for Microsoft identity platform authentication
# State: Enabled
# Supported on: At least Windows Vista

$path = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'fDisconnectOnLockMicrosoftIdentity' -Value 1 -Type DWord

Building a multi-setting collection? Add this setting and generate combined .reg / PowerShell / GPO scripts.

Open the Builder

Embed this policy on your site

What to embed
Theme

Adds one script line: the theme follows your site’s appearance and the height fits the content. If your site blocks scripts, the embed follows the visitor’s system theme.

Preview