The only method I know how to execute IPsec changes involves calling netsh to do the changes. Is there a method using System.Management and WMI objects directly? If so, what is
In IIS 7 IP restriction can be manipulate directly from config file, without messing with metadatabase. For easy maintenance config file can be split with configSource so that IPSecure section can be saved into it's own file.
Full article:
http://boseca.blogspot.com/2010/12/programmatically-addremove-ip-security.html