Do not allow LPT port redirection
Ne pas autoriser la redirection de port LPT
Explanation
This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session.
You can use this setting to prevent users from mapping local LPT ports and redirecting data from the remote computer to local LPT port peripherals. By default, Remote Desktop Services allows LPT port redirection.
If you enable this policy setting, users in a Remote Desktop Services session cannot redirect server data to the local LPT port.
If you disable this policy setting, LPT port redirection is always allowed.
If you do not configure this policy setting, LPT port redirection is not specified at the Group Policy level.
Ce paramètre de stratégie indique s’il faut ou non empêcher la redirection de données vers les ports LPT client lors d’une session de services Bureau à distance.
Vous pouvez utiliser ce paramètre pour empêcher les utilisateurs de mapper les ports LPT locaux et de rediriger les données à partir de l’ordinateur distant vers les périphériques de port LPT locaux. Par défaut, les services Bureau à distance autorisent la redirection du port LPT.
Si vous activez ce paramètre de stratégie, les utilisateurs d’une session de services Bureau à distance ne peuvent pas rediriger les données du serveur vers le port LPT local.
Si vous désactivez ce paramètre de stratégie, la redirection du port LPT est toujours autorisée.
Si vous ne configurez pas ce paramètre de stratégie, la redirection du port LPT n’est pas spécifiée au niveau de la stratégie de groupe.
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services- Value name
fDisableLPT
| 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_CLIENT_LPT
$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 'fDisableLPT' -Value 1 -Type DWordDisable
# Disable: TerminalServer/TS_CLIENT_LPT
$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 'fDisableLPT' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": TerminalServer/TS_CLIENT_LPT
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
Remove-ItemProperty -Path $k -Name 'fDisableLPT' -ErrorAction SilentlyContinue