Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • Use Google Maps’ Plus Codes To Share Your Location Easily How-To
  • How to Backup, Reset or Restore Your iPhone, iPad or iPod Computer Tips
  • Best ti inspire calculator 2020

    Best ti inspire calculator 2020. 1 - Navitech Purple Graphics Calculator Hard Case/Cover with Storage Pouch Compatible with The Texas N3/TBL/1E1 TI-N

  • Best online full screen scientific calculator websites Uncategorized
  • Best ti-30xs calculator 2020

    Best ti-30xs calculator 2020. 1 - Texas Instruments TI-30X IIS 2-Line Scientific Calculator, Dark Blue Top Reviews We or

  • Advanced Search on Reddit Like a Pro Computer Tips
  • How to install Database 12C Oracle on Windows How-To
  • The paypal fee calculator 2020 through an online transaction in usa Uncategorized

Enable or Disable Windows Firewall from Command Prompt

Posted on October 8, 2020 By blog_786 No Comments on Enable or Disable Windows Firewall from Command Prompt

There may come a time when you need to write a script or remotely connect to a PC and run a command to enable or disable Windows Firewall. For most IT environments, using Group Policy is the easiest way to configure Windows Firewall on client computers.

It is also the easiest way to add port exceptions for services like HTTP, file sharing, software applications, etc. However, it is also useful to know how to configure Windows Firewall from the command line in case you have computers and servers that not in Active Directory.

Manage Windows Firewall from Command Prompt

First, to find out if Windows Firewall is enabled on the server or computer, enter the following command at a command prompt:

netsh advfirewall show allprofiles

Make sure to open an Administrator Command Prompt (click Start, type CMD, then right-click Command Prompt and select Run as Administrator). You should have something similar to what is shown below:

Enable or Disable Windows Firewall from Command Prompt

By default, you should see three separate lists here: domain profile settings, personal profile settings, and public profile settings. These three correspond to three states in which you can place every network connection on your computer. If you are connected to a home network and have selected the Home Network option, the private profile settings will be applied.

– /

Status means whether the firewall is enabled. The firewall policy tells you which inbound and outbound policies are applied to each profile.

To disable the firewall for a specific profile, you must use the following command:

netsh advfirewall disable private profile status

Other options are current profile, general profile, domain profile, and all profiles. Therefore, if you want to disable the firewall completely, you should use allprofiles instead of privateprofile. To turn it back on, just put at the end, not turn it off.

Open the port in the firewall using the command line

What if you want to open a port in the firewall using the command line? It’s easy too!

Let’s say you want to open port 3389, which is for Remote Desktop on Windows. You just run this command:

netsh advfirewall firewall add rule name = “Open Remote Desktop” protocol = TCP dir = in localport = 3389 action = allow

The command is quite long, but rather easy to break. You add a rule, give it a name, select a protocol (TCP or UDP), select a direction (In or Out), assign a port number to it, and select an action (Allow or Deny).

If you run this command and then look at the allowed applications in Windows Firewall, you will see that the “Remote Desktop” item is now checked:

Enable or Disable Windows Firewall from Command Prompt

If you need to open a range of ports, just use a simple dash. For example, here I open ports 600o to 7000 for outgoing UDP traffic:

netsh advfirewall firewall add rule name = “UDP ports” protocol = UDP dir = out localport = 6000-7000 action = allow

There are many more additional commands that can be used to control all aspects of Windows Firewall, so be sure to use /? symbols at the end of any command to see all options and examples.

–

Share this:

  • Twitter
  • Facebook
Networking

Post navigation

Previous Post: How to Delete Blank Lines in Excel
Next Post: The Easiest Way to Use Kiosk Mode in Windows 10

Related Posts

  • What Does “Ethernet Doesn’t Have a Valid IP Configuration” Mean? Networking
  • How to Find Open and Blocked TCP/UDP Ports Networking
  • What Is DHCP Lease Time And How To Change It Networking
  • Best Way to Fix No Internet Protection Error in Windows 10 Networking
  • HDG Explains : What Is RFID & What Can It Be Used For? Networking
  • How to Estimate Bandwidth Requirements for a Business Site or Network Networking

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • 5 Cool Websites to Find Good Movies and TV Shows on Netflix
  • SmartDNS vs VPN – What’s the Difference?
  • How to go Back to the old YouTube Layout (2017)
  • A Simple Trick to Get 50% Discount on Audible for Three Months
  • What Is “Other” Storage on Android And How to Clean It Up ?
DMCA.com Protection Status

Recent Posts

  • How to Bypass Chromecast DNS and Circumvent Geo Blocking
  • 5 Cool Websites to Find Good Movies and TV Shows on Netflix
  • SmartDNS vs VPN “What’s the Difference?”
  • How to go Back to the old YouTube Layout (2013)
  • A Simple Trick to Get 50% Discount on Audible for Three Months

Recent Comments

  1. A Simple Trick to Get 50% Discount on Audible for Three Months on Private Browsing: What is it and What it is not
  2. 6 Best PayPal Alternatives (2017) on How to Save Money While Shopping Online in India
  3. Automatically Transcribe YouTube Video/Audio with Google Docs on 5 Best Team Management Apps (For Small and Large Teams)
  4. 6 Things You Need Know About Email Encryption on Delete All Emails from Gmail With Once Click
  5. Looking For YouTube Alternative? Try These 7 Video Sharing Sites on Ten Best YouTube Video Editing Software 2023
  • Are Expensive “Pro” Versions of Consoles For You? Gaming
  • AirPods Case Not Charging how To Fix it Hardware
  • Everything You Need To Know About SSD Wear & Tear Reviews
  • Aesthetic Wallpapers for Desktop: 7 Best Sites to Find Them Product Reviews
  • How To Use Windows Without a User Password Windows 10
  • TechWiser Explains: Why WiFi Signals Are Not Dangerous to Health How-To
  • How to build A home racing simulator? Gaming
  • What Is An Executable File & How To Create One How-To

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version