On Windows 10 1909, I can set to "Block all" with , as Admin :
(1 as parameter is for NET_FW_PROFILE2_DOMAIN)
$fwp = New-Object -ComObject hnetcfg.fwpolicy2
$fwp.BlockAllInboundTraffic(1) = 1
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Have to manage Windows firewall settings with Powershell, and have to configure the Windows firewall to not allow any incoming connections. All the automatically created firewall exception rules that Windows creates should also be blocked. We need the configuration for any Firewall profile according the following printscreen:
"set-netfirewallprofile -all -DefaultInboundAction Block " blocks incoming connections, but allows all the configured inbound rules. A parameter like "-DefaultInboundActions Blockall" seem not to exist and does not work.
Any advice how to get the configuration according the printscreen with Powershell? Thank you in advance for any help.
Franz
PS: Group Policy is not an option, we have to deploy Workgroup clients.
On Windows 10 1909, I can set to "Block all" with , as Admin :
(1 as parameter is for NET_FW_PROFILE2_DOMAIN)
$fwp = New-Object -ComObject hnetcfg.fwpolicy2
$fwp.BlockAllInboundTraffic(1) = 1
Hello Franz,
I also ignore if there is a equivalent in Powerhshell, but I have been using it from prompt:
to enable:
netsh advfirewall set domainprofile firewallpolicy blockinboundalways,allowoutbound
to disable:
netsh advfirewall set domainprofile firewallpolicy blockinbound,allowoutbound
Hope this helps,
--If the reply is helpful, please Upvote and Accept as answer--