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
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.
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
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_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 DWordDisable
# 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 DWordRevert 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