PowerShell Logo Small

Remove-NetFirewallRule



This is the built-in help made by Microsoft for the command 'Remove-NetFirewallRule', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Deletes one or more firewall rules that match the specified criteria.

SYNTAX


Remove-NetFirewallRule [-Action <Action[]>] [-AsJob] [-CimSession <CimSession[]>] [-Description <String[]>] [-Direction <Direction[]>] [-DisplayGroup <String[]>]
[-EdgeTraversalPolicy <EdgeTraversal[]>] [-Enabled <Enabled[]>] [-GPOSession <String>] [-Group <String[]>] [-LocalOnlyMapping <Boolean[]>] [-LooseSourceMapping <Boolean[]>]
[-Owner <String[]>] [-PassThru] [-PolicyStore <String>] [-PolicyStoreSource <String[]>] [-PolicyStoreSourceType <PolicyStoreType[]>] [-PrimaryStatus <PrimaryStatus[]>]
[-Status <String[]>] [-ThrottleLimit <Int32>] [-TracePolicyStore] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-All] [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
[-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallServiceFilter <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallAddressFilter <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallSecurityFilter <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallPortFilter <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallInterfaceTypeFilter <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallInterfaceFilter <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallApplicationFilter <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-Name] <String[]> [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>]
[-TracePolicyStore] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-DisplayName <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-TracePolicyStore]
-AssociatedNetFirewallProfile <CimInstance> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-NetFirewallRule [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-NetFirewallRule cmdlet permanently deletes one or more firewall rules from the specified policy store.


This cmdlet gets one or more firewall rules to be deleted with the Name parameter (default), the DisplayName parameter, rule properties, or by associated filters or objects.
The resulting queried rule is removed from the computer.


This cmdlet permanently removes a previously enabled firewall rule to be inactive within the computer or a group policy organizational unit. This cmdlet differs from the
Disable-NetFirewallRule cmdlet that disables a previously enabled firewall rule to be inactive within the computer or a group policy organizational unit. A disabled rule
will not actively modify computer behavior, but it still exists on the computer or in a GPO so it can be re-enabled.


After copying the firewall rules into a domain GPO, run this cmdlet, so the firewall rule does not conflict with the new domain GPO. When developing firewall policies, the
firewall rules can be created on the local computer.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=288124
Copy-NetFirewallRule
Enable-NetFirewallRule
Disable-NetFirewallRule
Get-NetFirewallAddressFilter
Get-NetFirewallApplicationFilter
Get-NetFirewallInterfaceFilter
Get-NetFirewallPortFilter
Get-NetFirewallProfile
Get-NetFirewallRule
Get-NetFirewallSecurityFilter
Get-NetFirewallServiceFilter
New-NetFirewallRule
Open-NetGPO
Rename-NetFirewallRule
Save-NetGPO
Set-NetFirewallRule
Show-NetFirewallRule
New-GPO

REMARKS

<

Examples


EXAMPLE 1

PS C:\>Remove-NetFirewallRule



This example removes all of the static local firewall rules. This is useful for removing any policy conflicts with the domain GPO.




EXAMPLE 2

PS C:\>Remove-NetFirewallRule -DisplayName "Network Discovery (NB-Name-In)"



This example deletes a firewall rule based on the localized name.




EXAMPLE 3

PS C:\>Remove-NetFirewallRule -Enabled False –PolicyStore contoso.com\gpo_name



This example removes all of the firewall rules that are currently disabled on a GPO.




EXAMPLE 4

PS C:\>$fwAppFilter = Get-NetFirewallApplicationFilter -Program "C:\Program Files (x86)\Messenger\msmsgs.exe"



PS C:\>Remove-NetFirewallRule –InputObject $fwAppFilter



This example removes all of the firewall rules associated with the Windows Messenger application.