Help - Search - Members - Calendar
Full Version: IPSec script?
The Planet Forums > Operating Systems > Microsoft Windows
al0000
Hello,

My problem is pretty simple:

I must add tons of subnets (in the xxx.xxx.xxx.xxx/xx format) to the IPsec policies. I am on Windows 2003 servers.

It will take forever to add them one by one...
It's almost 500 subnets.

Any suggestions? Is there an automation script or...?



Thanx!
Kyle
I wrote this to add a large port range for PASV FTP, but I'm sure you could modify it for use with subnets.

CODE
Set objShell = WScript.CreateObject("WScript.Shell")

For intN = 2001 To 2500
    objShell.Run "netsh ipsec static add filter filterlist=""FTP PASV Server"" srcaddr=me dstaddr=any protocol=TCP srcport="&CStr(intN)&" dstport=0 mirrored=yes description=""FTP PASV Listen""", 1, True
Next

Set objShell = Nothing
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.