Seguem alguns comandos para incrementar em seu script e facilitar o dia a dia e a automação de algumas atividades.
- Desabilitando Firewall – Xp
- netsh firewall set opmode disable
- Habilitando Firewall – Xp
- netsh firewall set opmode enable
- Habilitando Firewall – 7, 8 ou 10
- netsh advfirewall set currentprofile state on
- Desabilitando Firewall – 7, 8 ou 10
- netsh advfirewall set currentprofile state off
netsh firewall add portopening protocolo porta nome enable
ex.
netsh advfirewall add portopening ICMPv4 enable
netsh advfirewall add portopening TCP 80 HTTP enable
netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request”
protocol=icmpv4:8,any dir=in action=allow
netsh advfirewall firewall add rule name=”All ICMP V4″ dir=in action=block protocol=icmpv4
netsh advfirewall firewall add rule name=”All ICMP V4″ dir=out action=allow protocol=icmpv4
One Reply on “Como habilitar o Firewall do Windows via Script”