Category Filter

Execute scripts to turn on Firewall on Windows devices

Windows Firewall is a security mechanism that protects the device from unauthorized access. It helps secure the endpoints and permits you to create network rules for regulating network traffic. This doc assists you on how to configure firewall settings and rules using scripts via Hexnode UEM.

Disclaimer:

The Sample Scripts provided below are adapted from third-party Open-Source sites.

Setting up Windows Firewall using scripts

You can use both the Batch files and PowerShell commands to enable the firewall on Windows devices from the Hexnode console.

1. Batch Script

  • To enable Firewall on all profiles specifically domain, private and public:
  • To add a Firewall rule name for any given application (for instance, Internet Explorer) meant for the inbound traffic to the device:
  • To open a port in Firewall:

2. PowerShell Script

  1. To enable Firewall on all profiles specifically domain, private and public:
  2. To add Firewall rule name for any given application (for instance, Internet Explorer) meant for the inbound traffic to the device:
  3. To open a port in Firewall:
  4. Notes:

    • It is recommended to manually validate the script execution on a system before executing the action in bulk.
    • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.