Windows 10: How to modify existing firewall rule from CMD

Discus and support How to modify existing firewall rule from CMD in AntiVirus, Firewalls and System Security to solve the problem; Hello,I would like to modify firewall rule in CMD to have unblocked RDP.I have found this command somewhere:netsh advfirewall firewall add rule... Discussion in 'AntiVirus, Firewalls and System Security' started by david_ooo, Nov 22, 2022.

  1. david_ooo Win User

    How to modify existing firewall rule from CMD


    Hello,I would like to modify firewall rule in CMD to have unblocked RDP.I have found this command somewhere:netsh advfirewall firewall add rule name="Open Remote Desktop" protocol=TCP dir=in localport=3389 action=allow profile=domainbut it adds a new rule "Open Remote Desktop". I want to modify an existing, which is "Remotedesktop". How to do this from Command Line? I want also know how to reverse the rule to block RDP - in CMD as well. Thank you in advance.

    :)
     
    david_ooo, Nov 22, 2022
    #1
  2. Thelps Win User

    Enable/Disable Firewall Rules for 'Application Packages' using CMD?

    Hi all,

    I'm trying to use the CMD prompt command

    Netsh AdvFirewall Firewall SET RULE name="name" NEW...


    I'm trying to configure the Firewall Rules associated with the application packages found in "C:\Program Files\WindowsApps".

    However, for some reason, the usual CMD syntax to SET an existing firewall rule simply returns the error:

    No rules match the specified criteria

    This used to work in older versions of Windows 10. However, it doesn't work in Version 1909.

    Can someone explain how to use CMD Prompt to configure the pre-existing Firewall Rules that apply to Windows Apps?

    EDIT:

    The following command (using the Group= keyword) works:

    Netsh AdvFirewall Firewall Set Rule Group="3D Viewer" New Enable=no works fine.

    BUT

    Netsh AdvFirewall Firewall Set Rule Name="3D Viewer" New Enable=no

    returns 'No rules match the specfified criteria'.

    EDIT #2

    I have dumped the firewall rules to a .txt file.

    The rules that won't edit with the CMD prompt Netsh command all have names similar to the following in the .txt file:

    @{Microsoft.Microsoft3DViewer_5.1902.20012.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Microsoft3DViewer/Common.View.UWP/Resources/StoreAppName}

    When i supply these names under the Name= keyword field I still receive the No rules match the specified criteria error.

    EDIT #3

    Checking the Registry keys at:

    HKLM\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules

    Reveals that the rule I'm using as an example(3D Viewer) has the "name="field containing the above loooooong string from EDIT #2.

    Changing that stringto "3D Viewer"makes the rule editable using the syntax I've supplied (netsh AdvFirewall Firewall Set Rule).

    This doesn't solve my problem (now need to edit the registry keys for each of these 'broken' rule names) but it's a step in the right direction...
     
    Thelps, Nov 22, 2022
    #2
  3. Thelps Win User
    Enable/Disable Firewall Rules for 'Application Packages' using CMD?

    Update:

    If I specify the rule using the group= keyword then the rule(s) update.

    Unfortunately the group= keyword only lets me enable/disable rules. It won't let me modify them in any way.

    Can anyone suggest if this indicates the cause of the problem?

    Example:

    Netsh AdvFirewall Firewall Set Rule Group="3D Viewer" New Enable=no works fine.

    BUT

    Netsh AdvFirewall Firewall Set Rule Name="3D Viewer" New Enable=no

    returns 'No rules match the specified criteria'.
     
    Thelps, Nov 22, 2022
    #3
  4. How to modify existing firewall rule from CMD

    Windows 10 Firewall won't keep my inbound/outbound rules

    Hi,

    I realize the inconvenience caused to you regarding the Windows Firewall. I will certainly assist you.

    I suggest you to restart the Windows firewall service and check if it helps.

    Follow the below steps for the same.

    • Press Windows key + R simultaneously for Run.
    • Type services.msc and then Enter.
    • Right click on the Windows firewall services and then restart the services and check if it helps.
    If the issue still persists then I suggest you to remove and then read the Windows fire wall rule.

    Hope this information is helpful. Please get back to us with the information required, if you need further assistance, we’ll be glad to assist you.
     
    Anup Karkal, Nov 22, 2022
    #4
Thema:

How to modify existing firewall rule from CMD

Loading...
  1. How to modify existing firewall rule from CMD - Similar Threads - modify existing firewall

  2. How to restore deleted rules from the firewall?

    in Windows 10 Gaming
    How to restore deleted rules from the firewall?: Hi,I would like to know if it's possible to restore deleted rules from the outbound and inbound rules?accidentaly i deleted some rules and i want them back but i can't find a way...
  3. How to restore deleted rules from the firewall?

    in Windows 10 Software and Apps
    How to restore deleted rules from the firewall?: Hi,I would like to know if it's possible to restore deleted rules from the outbound and inbound rules?accidentaly i deleted some rules and i want them back but i can't find a way...
  4. How to modify existing firewall rule from CMD

    in Windows 10 Gaming
    How to modify existing firewall rule from CMD: Hello,I would like to modify firewall rule in CMD to have unblocked RDP.I have found this command somewhere:netsh advfirewall firewall add rule name="Open Remote Desktop" protocol=TCP dir=in localport=3389 action=allow profile=domainbut it adds a new rule "Open Remote...
  5. How to modify existing firewall rule from CMD

    in Windows 10 Software and Apps
    How to modify existing firewall rule from CMD: Hello,I would like to modify firewall rule in CMD to have unblocked RDP.I have found this command somewhere:netsh advfirewall firewall add rule name="Open Remote Desktop" protocol=TCP dir=in localport=3389 action=allow profile=domainbut it adds a new rule "Open Remote...
  6. Firewall rules

    in Windows 10 Network and Sharing
    Firewall rules: [ATTACH] Does this symbol mean I have blocked outbound traffic for an application? If so why did the app just check for an update and confirm its current version? https://answers.microsoft.com/en-us/windows/forum/all/firewall-rules/870791a0-328a-4d5c-ad0a-be99f93dfdb0
  7. Windows Firewall rules being modified/added then immediately deleted

    in AntiVirus, Firewalls and System Security
    Windows Firewall rules being modified/added then immediately deleted: Essentially we have been seeing many different logs for "A rule was modified" EVID 4947 in the Windows Firewall, the rule name and rule ID are GUIDs which lead us to believe the rules being modified weren't initially created by a user. When looking for the modified rule on...
  8. Firewall Rules

    in Windows 10 Network and Sharing
    Firewall Rules: Can you setup exceptions for firewall rules? For example, if I have a port blocked inbound for ALL via GPO, can I create an exception to that rule to allow just certain IP addresses to get through the port being blocked? Win 10 ENT in a domain environment....
  9. Firewall rules

    in AntiVirus, Firewalls and System Security
    Firewall rules: I accidentally deleted outbound windows firewall rules. Will these reappear? Can this be dangerous? Please help. Thanks https://answers.microsoft.com/en-us/windows/forum/windows_10-security/firewall-rules/1f7cbdda-d9e2-435a-96cb-6caef7699b88"
  10. How to export rules from Win Firewall?

    in AntiVirus, Firewalls and System Security
    How to export rules from Win Firewall?: How can one export one's own rules from Win Firewall? And how can one import them (e.g. to a new computer or to the same one if a re-install of Win is necessary)? [img] 72484