Alternative Port Mappings
Mappages de ports de remplacement
Explanation
This policy setting determines the alternative port registry mappings used by the SMB client.
If you enable this policy setting, the first valid mapping will be used if the mapping's server name matches the targeted server name for connectivity.
If you enable this policy setting and do not specify at least one valid mapping, or if you disable or do not configure this policy setting, then the SMB client will refer to other methods of determining alternative port usage such as with the NET USE or New-SmbMapping commands.
Examples:
contososa.file.core.windows.net:tcp:448
edgesrv1.corp.contoso.com:quic:450
How to modify this setting:
Arrange the desired alternative port mappings in the edit box with one mapping entry per line.
The format of each mapping entry specifies a server name, transport type, and port number separated by colons as done so in the example above.
Note: This policy does not require a Windows reboot to take effect.
Ce paramètre de stratégie détermine les mappages de Registre de port alternatifs utilisés par le client SMB.
Si vous activez ce paramètre de stratégie, le premier mappage valide est utilisé si le nom du serveur du mappage correspond au nom du serveur ciblé pour la connectivité.
Si vous activez ce paramètre de stratégie et ne spécifiez pas au moins un mappage valide, ou si vous désactivez ou ne configurez pas ce paramètre de stratégie, le client SMB fait référence à d’autres méthodes de détermination de l’utilisation d’autres ports, telles que les commandes NET USE ou New-SmbMapping.
Exemples:
contososa.file.core.windows.net :tcp :448
edgesrv1.corp.contoso.com :quic :450
Comment modifier ce paramètre :
Organisez les mappages de port de remplacement souhaités dans la zone d’édition avec une entrée de mappage par ligne.
Le format de chaque entrée de mappage spécifie un nom de serveur, un type de transport et un numéro de port séparés par deux-points comme indiqué dans l’exemple ci-dessus.
Remarque : cette stratégie ne nécessite pas de redémarrage de Windows pour prendre effet.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\LanmanWorkstation- 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: LanmanWorkstation/Pol_AlternativePortMappings
$k = 'HKLM:\Software\Policies\Microsoft\Windows\LanmanWorkstation'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
#
Set-ItemProperty -Path $k -Name 'AlternativePortMappings' -Value @('<value1>', '<value2>') -Type MultiStringDisable
# Disable: LanmanWorkstation/Pol_AlternativePortMappings
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": LanmanWorkstation/Pol_AlternativePortMappings
$k = 'HKLM:\Software\Policies\Microsoft\Windows\LanmanWorkstation'
Remove-ItemProperty -Path $k -Name 'AlternativePortMappings' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| MultiText_AlternativePortMappings | Multiline text boxmultiText | AlternativePortMappings | REG_MULTI_SZ |