Always prompt for password upon connection
Toujours demander le mot de passe à la connexion
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.
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
| 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_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 DWordDisable
# 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 DWordRevert 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