I have a set of scripts I run when I prep a computer for deployment. Â At specific points applications require that the windows firewall be turned off in order to install correctly. Â This is namely ACT! and imagine time. Â They use a bunch of odd ports during install, so their documentation tells you to just turn off the firewall. Well here is what I found with a little research. Â From run or in a batch file there is a simple netsh command to disable the firewall and one to again enable it.
For imagine time my install script looks like this
g:\Imagine_time\IT_SETUP.exe /q /p
netsh firewall set opmode enable
Â
Effectively this will turn off the firewall, install the software silently from a share, and then enable the firewall again after install. I found something interesting with this in regards to kaseya too.  Sometimes VNC can’t get through the firewall because it has defaulted or something went wrong.  It turns out that if you run this as “system” you can actually disable the firewall remotely in many cases.  This has been a very helpful script for when a computer shows ‘connectable’ but it just times out when attempting connection.
Script Description: Turns off windows firewall
IF TrueÂ
THEN
  Execute Shell Command
   Parameter 1 : netsh firewall set opmode disable
   Parameter 2 : 1
     OS Type : 0
ELSE
Additionally, Â if you change enable to disable in the above script, you can enable the firewall remotely through kaseya as well.