Open in the explorer

Always prompt for password upon connection

Toujours demander le mot de passe à la connexion

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
At least Windows Server 2003 operating systems or Windows XP Professional FR: Au minimum Windows Server 2003 ou Windows XP Professionnel
ADMX file
TerminalServer.admx
Internal name
TerminalServer/TS_PASSWORD

Explanation

This policy setting specifies whether Remote Desktop Services always prompts the client for a password upon connection.

You can use this setting to enforce a password prompt for users logging on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client.

By default, Remote Desktop Services allows users to automatically log on by entering a password in the Remote Desktop Connection client.

If you enable this policy setting, users cannot automatically log on to Remote Desktop Services by supplying their passwords in the Remote Desktop Connection client. They are prompted for a password to log on.

If you disable this policy setting, users can always log on to Remote Desktop Services automatically by supplying their passwords in the Remote Desktop Connection client.

If you do not configure this policy setting, automatic logon is not specified at the Group Policy level.

French text from Windows 11 26H2

Ce paramètre de stratégie spécifie si les services Bureau à distance demandent toujours un mot de passe au client lors de la connexion.

Vous pouvez utiliser ce paramètre pour forcer la demande de mot de passe aux utilisateurs se connectant aux services Bureau à distance, même s’ils ont déjà fourni le mot de passe dans le client Connexion Bureau à distance.

Par défaut, les services Bureau à distance autorisent les utilisateurs à se connecter automatiquement en entrant un mot de passe dans le client Connexion Bureau à distance.

Si vous activez ce paramètre de stratégie, les utilisateurs ne peuvent pas se connecter automatiquement aux services Bureau à distance en fournissant leurs mots de passe dans le client Connexion Bureau à distance. Un mot de passe leur est demandé pour ouvrir une session.

Si vous désactivez ce paramètre de stratégie, les utilisateurs peuvent toujours se connecter automatiquement aux services Bureau à distance en fournissant leurs mots de passe dans le client Connexion Bureau à distance.

Si vous ne configurez pas ce paramètre de stratégie, l’ouverture de session automatique n’est pas spécifiée au niveau de la stratégie de groupe.

Use cases

Forces the Remote Desktop server to always ask for the password, even if the user saved it in the Remote Desktop Connection client. When enabled, automatic logon with a password supplied in the client is impossible; when disabled, it is always possible.

Consider it on sensitive servers or shared machines, where an .rdp file with saved credentials would let anyone open the session. When not configured, automatic logon is not set by the GPO, but an administrator can still require the prompt in the session host configuration tool.

Microsoft source: Security (Terminal Services policies)

Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
Value name
fPromptForPassword
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_PASSWORD
$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 'fPromptForPassword' -Value 1 -Type DWord

Disable

# Disable: TerminalServer/TS_PASSWORD
$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 'fPromptForPassword' -Value 0 -Type DWord

Revert to "Not configured"

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

Availability