以编程方式将IP添加到Server 2008防火墙规则 [英] Programmatically add IP to Server 2008 firewall rule
问题描述
有人知道如何以编程方式将IP地址添加到具有高级安全性规则的Server 2008 Windows防火墙吗?
Anybody know how to programmatically add an IP address to a Server 2008 Windows Firewall with Advanced Security rule?
即我已经设置了阻止操作"防火墙规则,该规则在作用域"的远程IP地址"部分下列出了一些IP地址.我希望能够以编程方式从此列表中添加(或删除)IP地址.是否有.NET对象可用于执行此操作?
i.e. I've setup a Block Action firewall rule which has some IP addresses listed under the "Remote IP address" section of the Scope. I want to be able to programmatically add (or perhaps remove) IP addresses from this list. Are there .NET objects available to do this?
推荐答案
具有高级安全性的Windows防火墙起始页位于:
The Windows Firewall with Advanced Security Start Page can be found at:
http://msdn.microsoft.com /en-us/library/ff956124(v=VS.85).aspx
具体来说,似乎您需要使用INetFwRule接口,该接口在以下位置进行了描述:
Specifically, it seems you need the INetFwRule Interface which is described at:
http://msdn.microsoft.com /en-us/library/aa365344(v=VS.85).aspx
检查get_RemoteAddresses和put_RemoteAddresses
Check the get_RemoteAddresses and put_RemoteAddresses
这篇关于以编程方式将IP添加到Server 2008防火墙规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!