Easily turn off Windows Firewall with netsh or in the PowerShell
There are still situations where it is necessary to disable the firewall. There are supported methods for this, where the service does not need to be stopped or disabled. On Windows Server 2008 R2 or later, you can disable the firewall from the console using netsh commands. Windows Server 2012 or later also allows the Set-NetFirewallProfile PowerShell cmdlet to run.
Turn off the firewall with Windows PowerShell.
To do this, open Windows PowerShell as an administrator and run the following line:
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
Reactivating the Windows Defender Firewall requires -Enable True instead of False at the end.
This is how you disable the firewall with the netsh command.
Open a command prompt with administrative privileges and insert the following command:
netsh advfirewall set allprofiles state off