Open in the explorer

Disconnect remote session on lock for Microsoft identity platform authentication

Déconnecter la session distante lors du verrouillage pour l’authentification Plateforme d'identités Microsoft

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_AAD_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 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.

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 distante 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 d’un fournisseur d’identité qui utilise le Plateforme d'identités Microsoft, tel que Microsoft Entra ID, pour s’authentifier auprès du PC distant. Cette stratégie ne s’applique pas lors de l’utilisation de l’authentification héritée qui inclut les protocoles d’authentification de base NTLM, CredSSP, RDSTLS, TLS et RDP.

Si vous activez ou ne configurez pas ce paramètre de stratégie, Bureau à distance connexions utilisant le Plateforme d'identités Microsoft déconnecte la session à distance lorsque la session à distance est verrouillée. Les utilisateurs peuvent se reconnecter lorsqu’ils sont prêts et peuvent utiliser l’authentification sans mot de passe si elles sont configurées.

Si vous désactivez ce paramètre de stratégie, Bureau à distance connexions utilisant le Plateforme d'identités Microsoft affiche l’écran de verrouillage à distance lorsque la session à distance 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
fDisconnectOnLockMicrosoftIdentity
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_AAD_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 'fDisconnectOnLockMicrosoftIdentity' -Value 1 -Type DWord

Disable

# Disable: TerminalServer/TS_DISCONNECT_ON_LOCK_AAD_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 'fDisconnectOnLockMicrosoftIdentity' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": TerminalServer/TS_DISCONNECT_ON_LOCK_AAD_POLICY
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
Remove-ItemProperty -Path $k -Name 'fDisconnectOnLockMicrosoftIdentity' -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