Windows Defender Firewall: Allow local port exceptions
Pare-feu Windows Defender : autoriser les exceptions de ports locaux
Explanation
Allows administrators to use the Windows Defender Firewall component in Control Panel to define a local port exceptions list. Windows Defender Firewall uses two port exceptions lists; the other is defined by the "Windows Defender Firewall: Define inbound port exceptions" policy setting.
If you enable this policy setting, the Windows Defender Firewall component in Control Panel allows administrators to define a local port exceptions list.
If you disable this policy setting, the Windows Defender Firewall component in Control Panel does not allow administrators to define a local port exceptions list. However, local administrators will still be allowed to create firewall rules in the Windows Defender Firewall with Advanced Security snap-in. If you wish to prevent all locally created rules from applying, use the Group Policy Object Editor snap-in and configure Computer Configuration\Windows Settings\Security Settings\Windows Defender Firewall with Advanced Security to specify that local firewall rules should not apply.
Permet aux administrateurs d'utiliser le composant Pare-feu Windows Defender du Panneau de configuration afin de définir une liste d'exceptions de ports locaux. Le Pare-feu Windows Defender utilise deux listes d'exceptions de ports ; la deuxième est définie par le paramètre de stratégie « Pare-feu Windows Defender : définir les exceptions de ports entrants ».
Si vous activez ce paramètre de stratégie, le composant Pare-feu Windows Defender du Panneau de configuration autorisera les administrateurs à définir une liste d'exceptions de ports locaux.
Si vous désactivez ce paramètre de stratégie, le composant Pare-feu Windows Defender du Panneau de configuration n'autorisera pas les administrateurs à définir une liste d'exceptions de ports locaux. Toutefois, les administrateurs locaux seront toujours autorisés à créer des règles de pare-feu dans le composant logiciel enfichable Pare-feu Windows Defender avec fonctions avancées de sécurité. Si vous souhaitez empêcher l'application de toutes les règles créées localement, utilisez le composant logiciel enfichable Éditeur d'objets de stratégie de groupe et configurez le Pare-feu Windows Defender avec fonctions avancées de sécurité (Configuration ordinateur\Paramètres Windows\Paramètres de sécurité) de sorte que les règles de pare-feu locales ne soient pas appliquées.
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\StandardProfile\GloballyOpenPorts- Value name
AllowUserPrefMerge
| 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: WindowsFirewall/WF_OpenPortsLocal_Name_2
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\StandardProfile\GloballyOpenPorts'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowUserPrefMerge' -Value 1 -Type DWordDisable
# Disable: WindowsFirewall/WF_OpenPortsLocal_Name_2
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\StandardProfile\GloballyOpenPorts'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowUserPrefMerge' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": WindowsFirewall/WF_OpenPortsLocal_Name_2
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\StandardProfile\GloballyOpenPorts'
Remove-ItemProperty -Path $k -Name 'AllowUserPrefMerge' -ErrorAction SilentlyContinue