locked
How to control ICS firewall programatically? RRS feed

  • Question

  • I'd like to add, remove, enable, and disable entries in the ICS firewall via a powershell script.  If not powershell then C# would be okay.

    Is this possible?  If so, can anyone share an example or any other guidance?

    I have been trying to interface with the HNetCfg.dll as a COM object in powershell (Interop.NETCONLib in C#).  This has been difficult becuase of sketchy documentation and my own inexperience using COM objects.

    Monday, January 31, 2011 3:34 PM

All replies

  • Have you looked at just shelling out to NETSH.exe?

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - ProGuide to WES 7, XP Embedded Advanced, WEPOS / POS for .NET Step-by-Step
    Tuesday, February 1, 2011 12:29 AM
  • Sure, netsh is okay too.  However, my research on using netsh for ICS has turned up nothing.  Any pointers?

    All I want is to enable/disable interface sharing (ICS) and add, delete, enable, disable ICS firewall rules.  Seems so simple, doesn't it?

    -Steve

    Tuesday, February 1, 2011 12:36 AM