1

I'm trying to setup a script to unblock IP's that may get caught up in a custom rule on Windows Firewall. I am trying this:

netsh advfirewall firewall delete rule name="rule_name" remoteip="ip"

In the scope within Windows Firewall, I see the IP is listed and blocked but when I try to run the script I am getting:

No rules match the specified criteria.

Is this the correct way to script to remove these IPs on an automated script or is there a simpler way to approach this?

  • What version of Windows? If Windows 10 you would probably be better off using the Powershell commandlets from the NetSecurity module instead of the netsh. In any case if you need more help unblocking something it might help to add a screenshot or log entry with the information about the rule or whatever that you are trying to bypass. – Zoredache Aug 3 '17 at 23:20
  • It is for Server 2016 (it looks like that was stripped off). Its literally a block connection rule in the incoming tab (to all ports, etc for excessive login attempts). Just trying to remove an IP from the scope tab that got added in error on an automated basis. – Win CS Aug 3 '17 at 23:50
  • I am not too familiar with that but maybe something with the Get-NetFirewallAddressFilter and Set-NetFirewallAddressFilter PS commands? – Zoredache Aug 4 '17 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.