How do I assign Windows Firewall profiles to network interfaces from the command line?

6

3

I would like to assign Windows Firewall's public profile to the public Ethernet interface and the private profile to the private Ethernet interface. I can do this with the GUI via

  1. Open Windows Firewall with Advanced Security
  2. Click on Windows Firewall Properties
  3. Click the Private Profile Tab
  4. Click Customize
  5. Select the Interface I want (private)
  6. Click OK
  7. Repeat step 3-6 for the public profile

How do I do this via command line? I'm using Windows Server 2008 R2

David

Posted 2011-05-18T10:03:32.127

Reputation: 525

You can find full information about Netsh AdvFirewall Firewall Commands at MS Technet: TechNet Library: Windows Server Netsh AdvFirewall Firewall Commands

– climenole – 2012-09-22T17:24:33.563

Answers

2

I'm afraid this GUI won't assign profiles to interfaces. It seems like it can only guarantee that certain profile won't apply to certain NIC when Windows thinks its network classifies as such profile. Mind the name of the PS parameter, "DisabledInterfaceAliases".

hypersw

Posted 2011-05-18T10:03:32.127

Reputation: 121

1this GUI? The question is about assigning profiles from the command line. – suspectus – 2015-08-09T20:02:42.443

The question assumes this can be done via GUI in the first place, which I doubt. This also affects the possible cmdline answer — because, if it does the same as the GUI and the GUI does not do what the authour assumes, the outcome would be less than useful. – hypersw – 2015-08-12T17:05:09.300

1

From PowerShell: Set-NetFirewallProfile -Name %ProfileName% -DisabledInterfaceAliases %YouConnectionName%

Aleksandr Vishnyakov

Posted 2011-05-18T10:03:32.127

Reputation: 161