How To: Firewall Commands In Server Core

by [Published on 1 July 2009 / Last Updated on 26 Feb. 2009]

This article explains the commands you can use to operate Windows Firewall in Server Core

Server Core has no GUI tool to perform tasks related to firewall. You need to use NetSH command line tool to make changed to the Windows Firewall. This article lists the useful NetSH commands for Windows Firewall:

NetSH ADVFirewall

The above command is used to list switches available for Windows Firewall operation.

There are three Firewall Profiles configured on Windows Vista and Windows Server 2008. To check the status of Windows Firewall for all three profiles, issue the following commands:

NetSH ADVFirewall Show Allprofiles

The State column will show the firewall status: ON | OFF.

To turn Windows Firewall on for all profiles, issue the following command:

NetSH ADVFirewall Set Allprofiles State ON

Use OFF switch to turn the firewall off with above command.

To reset the Windows Firewall and configure with the default parameters, use the following command:

NetSH ADVFirewall Set Allprofiles FirewallPolicy BlockInbound,AllowOutbound

To enable/disable a specific feature, use the following command: In below example, the Remote Management (WinRM) feature will be enabled.

NetSH ADVFirewall Set AllProfiles Settings remotemanagement Enable / DIsable


See Also

The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP and was awarded the Microsoft MVP award in Directory Services and Windows Networking. He specializes in Microsoft Azure, Office 365, Directory Services, Failover Clusters, Hyper-V, PowerShell Scripting and System Center products. Nirmal has been involved with Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to PowerShell-based Dynamic Packs for www.ITDynamicPacks.Net solutions.

Featured Links