Open in the explorer

Disconnect remote session on lock for legacy authentication

Déconnecter la session distante sur le verrou pour l’authentification héritée

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Remote Desktop Services › Remote Desktop Session Host › Security FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Services Bureau à distance › Hôte de la session Bureau à distance › Sécurité
Supported on
SUPPORTED_Windows_11_0_22H2_SERVER
ADMX file
TerminalServer.admx
Internal name
TerminalServer/TS_DISCONNECT_ON_LOCK_POLICY

Explanation

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 legacy authentication to authenticate to the remote PC. Legacy authentication is limited to username and password, or certificates like smartcards. Legacy authentication doesn't leverage the Microsoft identity platform, such as Microsoft Entra ID. Legacy authentication includes the NTLM, CredSSP, RDSTLS, TLS, and RDP basic authentication protocols.

If you enable this policy setting, Remote Desktop connections using legacy authentication will disconnect the remote session when the remote session is locked. Users can reconnect when they're ready and re-enter their credentials when prompted.

If you disable or do not configure this policy setting, Remote Desktop connections using legacy authentication 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.

French text from Windows 11 26H2

Ce paramètre de stratégie vous permet de configurer l’expérience utilisateur lorsque la session Bureau à distance est verrouillée par l’utilisateur ou par une stratégie. Vous pouvez spécifier si la session à distance affiche l’écran de verrouillage à distance ou se déconnecte quand la session distante est verrouillée. La déconnexion de la session à distance garantit qu’une session distante ne peut pas être laissée sur l’écran de verrouillage et ne peut pas se reconnecter automatiquement en raison d’une perte de connectivité réseau.

Cette stratégie s’applique uniquement lors de l’utilisation de l’authentification héritée pour s’authentifier sur le PC distant. L’authentification héritée est limitée au nom d’utilisateur et au mot de passe, ou aux certificats tels que les cartes à puce. L’authentification héritée ne tire pas parti des Plateforme d'identités Microsoft, comme Microsoft Entra ID. L’authentification héritée inclut les protocoles d’authentification de base NTLM, CredSSP, RDSTLS, TLS et RDP.

Si vous activez ce paramètre de stratégie, Bureau à distance connexions utilisant l’authentification héritée déconnecte la session distante lorsque la session distante est verrouillée. Les utilisateurs peuvent se reconnecter lorsqu’ils sont prêts et entrer à nouveau leurs informations d’identification lorsqu’ils y sont invités.

Si vous désactivez ou ne configurez pas ce paramètre de stratégie, Bureau à distance connexions utilisant l’authentification héritée affiche l’écran de verrouillage à distance lorsque la session distante est verrouillée. Les utilisateurs peuvent déverrouiller la session à distance à l’aide de leur nom d’utilisateur et de leur mot de passe, ou de certificats.

Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
Value name
fDisconnectOnLockLegacy
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: TerminalServer/TS_DISCONNECT_ON_LOCK_POLICY
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'fDisconnectOnLockLegacy' -Value 1 -Type DWord

Disable

# Disable: TerminalServer/TS_DISCONNECT_ON_LOCK_POLICY
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'fDisconnectOnLockLegacy' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": TerminalServer/TS_DISCONNECT_ON_LOCK_POLICY
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
Remove-ItemProperty -Path $k -Name 'fDisconnectOnLockLegacy' -ErrorAction SilentlyContinue

Availability

Windows 11

Windows 10

— 22H2— 21H2— 21H1— 20H2— 2004— 1909— 1903— 1809— 1803— 1709— 1703— 1607— 1511— 1507

Windows Server

✓ 2025— 2022— 2016