Anybody know how to programmatically add an IP address to "IPv4 and domain restrictions" in IIS7 using vb.net.
i.e I want to exclude some ips or range of IPs from accessing certain folders on my server and allow certain users to access it.
I found those nice articles :
http://www.iis.net/configreference/system.webserver/security/ipsecurity/add
Maybe you can add the restrictions by executing some command line tool.
(The following information is copy-pasted from Microsoft IIS documentation)
Configure IPv4 Address and Domain Name Allow Rules (IIS 7) (Original document here)
Update For executing the command, you can use a code like the following
I've never used the appcmd command line tool, so you'll need to look at the documentation, and understand how to use it.