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