Note: If you get errors, or if the setting won't turn on, you can use the troubleshooter and then try again. If there's an app you need to use that's being blocked, you can allow it through the firewall, instead of turning the firewall off. To turn it off, switch the setting to Off. Turning off Microsoft Defender Firewall could make your device (and network, if you have one) more vulnerable to unauthorized access. For more info, contact your administrator. If your device is connected to a network, network policy settings might prevent you from completing these steps. Under Microsoft Defender Firewall, switch the setting to On. Select the Start button > Settings > Update & Security > Windows Security and then Firewall & network protection. To turn Microsoft Defender Firewall on or off: It helps protect you from unauthorized access. Select Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender.
It's important to have Microsoft Defender Firewall on, even if you already have another firewall on. Then select Edit group policy from the listed results.