Disable Firewall Remotely

email me

How to remotely disable the firewall on a Windows machine.

psexec \\MACHINENAME -u administrator -p PASSWORD netsh advfirewall set allprofiles state off


Notes

netsh advfirewall set currentprofile state on

netsh advfirewall set currentprofile state off


netsh advfirewall set currentprofile state on

Domain network

Turn on Domain network firewall:
netsh advfirewall set domainprofile state on

Turn off domain network firewall:
netsh advfirewall set domainprofile state off

Private network

Turn on private network firewall:
netsh advfirewall set privateprofile state on

Turn off private network firewall:
netsh advfirewall set privateprofile state off


Public network

Turn on public network firewall:
netsh advfirewall set publicprofile state on

Turn off public network firewall:
netsh advfirewall set publicprofile state off

 

Configure for all networks

Turn on firewall for all networks:
netsh advfirewall set allprofiles state on

Turn off firewall for all networks:
netsh advfirewall set allprofiles state off