Are there WFP apis that can disable / delete Firewall rules ?

Sinha Prokash 46 Reputation points
2022-03-11T22:24:01.49+00:00

When a service ( .exe ) add firewall rules, it can have the Id's cached, and delete those rules as needed...

Now, client machine by default comes with quite a few rules ( that can be deleted or disabled using the defender firewall ). Is there equivalent APIs. May be enumeration based !!

Thanks,
Prokash

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,689 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 19,651 Reputation points Microsoft Vendor
    2022-03-14T07:20:54.607+00:00

    Hello, @Sinha Prokash
    Welcome to Microsoft Q&A!

    I can't find any relevant functionality in the WFP API.
    Hope this article can help you. It describes the operation of the firewall rule with Netsh and Powershell.
    https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-firewall/windows-firewall-with-advanced-security-administration-with-windows-powershell#delete-a-firewall-rule

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.