Programmatically add and modify IPsec policies

  • Thread starter Colin Eric Johnson
  • Start date
C

Colin Eric Johnson

I'd like to be able to add and modify IPsec policies on standalone
machines (not in a domain) from a script or program. Right now I can
make changes with the Local Security Policy tool but that requires user
intervention on a level that I don't want to have in place. I'd like to
write something that can make the changes needed and/or add new IPsec
policies with minimal input from the user.

My intended audience are folks who move around with their laptops a fair
bit and need one policy in one place and another or no policy in another
place.

Can this be down with something like WMI or is there another API that
allows this kind of scripting? I haven't found anything in my searches
of the Microsoft web site or the web in general (thank you google). If
someone could point me in the right direction I think I could take it
from there.

-- colin j.
 
S

Steve Riley [MSFT]

There are no public APIs for IPsec. You can, however, use a command-line
tool to create IPsec policies through scripts. The tool is different
depending on the version of Windows:

Windows 2000 Pro and Server: IPSECPOL
Windows XP: IPSECCMD
Windows Server 2003: NETSH IPSEC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top