PowerShell Logo Small

Set-NetFirewallApplicationFilter



This is the built-in help made by Microsoft for the command 'Set-NetFirewallApplicationFilter', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' 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

Modifies application filter objects, thereby modifying the program and package conditions of the firewall rules.

SYNTAX


Set-NetFirewallApplicationFilter [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-Package <String>] [-PassThru] [-PolicyStore <String>] [-Program <Strin
g>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-NetFirewallApplicationFilter [-AsJob] [-CimSession <CimSession[]>] [-Package <String>] [-PassThru] [-Program <String>] [-ThrottleLimit <Int32>] -InputObject <CimI
nstance[]> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-NetFirewallApplicationFilter cmdlet modifies the applications associated with the input firewall rules.


See the Get-NetFirewallApplicationFilter cmdlet for more information on application filters.


To modify the application conditions, two methods can be used starting with the application filters returned by the Get-NetFirewallApplicationFilter cmdlet and option
al additional querying.

-- The application filter objects can be piped to the Get-NetFirewallRule cmdlet, which returns the rule objects associated with the filters. These rules are then pi
ped to the Set-NetFirewallRule cmdlet where the application properties can be configured.

-- Alternatively, piping the address filter objects directly to this cmdlet allows the Program and Package parameters of the rules to be specified.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=288211
Get-NetFirewallApplicationFilter
Get-NetFirewallRule
Get-NetIPSecRule
New-NetFirewallRule
New-NetIPSecRule
Open-NetGPO
Save-NetGPO
Set-NetFirewallRule
Set-NetIPSecRule
New-GPO

REMARKS

<

Examples


EXAMPLE 1

PS C:\>$nfwApplicationFilter = ( Get-FirewallRule –DisplayName "Contoso Messenger" | Get-NetFirewallApplicationFilter )



PS C:\>Set-NetFirewallApplicationFilter –InputObject $nfwApplicationFilter –Program %SystemRoot%\System32\messenger.exe


This cmdlet can be run using only the pipeline.
PS C:\>Get-FirewallRule –DisplayName "Contoso Messenger" | Get-NetFirewallApplicationFilter | Set-NetFirewallApplicationFilter –Program %SystemRoot%\System32\messenge
r.exe


This cmdlet can be run without using the pipeline.
PS C:\>Set-NetFirewallRule –DisplayName "Contoso Messenger" –Program %SystemRoot%\System32\messenger.exe



This example changes the application path associated with a particular firewall rule.




EXAMPLE 2

PS C:\>$NewPackageSDDL = "S-1-15-2-4292807980-2381230043-3108820062-1451069988-2614848061-670482394-695399705"



PS C:\>$nfwApplicationFilter = (Get-NetFirewallRule –Group Socialite | Get-NetFirewallApplicationFilter )



PS C:\>Set-NetFirewallAddressFilter – InputObject $nfwApplicationFilter –Package $NewPackageSDDL


This cmdlet can be run using only the pipeline.
PS C:\>Get-NetFirewallRule –Group Socialite | Get-NetFirewallApplicationFilter | Set-NetFirewallAddressFilter –Package $NewPackageSDDL



This example modifies the package associated with all related firewall rules for the Socialite Windows Store application.