Configure RPC over TCP port
Configurer RPC sur le port TCP
Explanation
This policy setting controls which port is used for RPC over TCP for incoming connections to the print spooler and outgoing connections to remote print spoolers.
By default dynamic TCP ports are used.
RPC over TCP port:
-- The port to use for RPC over TCP. A value of 0 is the default and indicates that dynamic TCP ports will be used
If you disable or do not configure this policy setting, dynamic TCP ports are used.
Ce paramètre de stratégie contrôle le port utilisé pour RPC sur TCP pour les connexions entrantes au spouleur d’impression et les connexions sortantes aux spouleurs d’impression distants.
Par défaut, les ports TCP dynamiques sont utilisés.
Port RPC sur TCP :
-- Port à utiliser pour RPC sur TCP. La valeur 0 est la valeur par défaut et indique que les ports TCP dynamiques seront utilisés
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les ports TCP dynamiques sont utilisés.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
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: Printing/ConfigureRpcTcpPort
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers\RPC'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# RPC over TCP port
Set-ItemProperty -Path $k -Name 'RpcTcpPort' -Value 0 -Type DWord # maximum 65535Disable
# Disable: Printing/ConfigureRpcTcpPort
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": Printing/ConfigureRpcTcpPort
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers\RPC'
Remove-ItemProperty -Path $k -Name 'RpcTcpPort' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| RPC over TCP port:RPC sur le port TCP :RpcTcpPort | Numeric boxdecimal | RpcTcpPort | REG_DWORD | Max: 65535 · Default (UI): 0 |