PowerShell Logo Small

Set-NetFirewallInterfaceFilter



This is the built-in help made by Microsoft for the command 'Set-NetFirewallInterfaceFilter', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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

Modifies interface filter objects, thereby modifying the InterfaceAlias parameter values of the firewall or IPsec rules.

SYNTAX


Set-NetFirewallInterfaceFilter [-AsJob [<SwitchParameter>]] [-CimSession <CimSession[]>] [-GPOSession <String>] [-InterfaceAlias <String[]>]
[-PassThru [<SwitchParameter>]] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
[<CommonParameters>]
Set-NetFirewallInterfaceFilter [-AsJob [<SwitchParameter>]] [-CimSession <CimSession[]>] [-InterfaceAlias <String[]>] [-PassThru
[<SwitchParameter>]] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
[<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-NetFirewallInterfaceFilter cmdlet modifies the interfaces associated with the input firewall rules.


See the Get-NetFirewallInterfaceFilter cmdlet for more information about the interface filters.


To modify the interface conditions, two methods can be used starting with the Get-NetFirewallInterfaceFilter cmdlet that returns the interface
filter objects and optional additional querying.

-- The network firewall interface filter objects are piped into the Get-NetFirewallRule or Get-NetIPsecRule cmdlet. The Get-NetFirewallRule
or Get-NetIPsecRule cmdlet returns the rules objects associated with the filters rules and pipes the rules objects into the
Set-NetFirewallRule or Set-NetIPsecrule cmdlet, which configures the interface properties.

-- Alternatively, the network firewall interface filter objects are piped directly to this cmdlet, which modifies the Program and Package
parameter values of the rules.



<

RELATED LINKS

Where-Object
Copy-NetIPsecRule
Get-NetFirewallApplicationFilter
Get-NetFirewallInterfaceFilter
Get-NetFirewallRule
Get-NetIPSecRule
New-NetFirewallRule
New-NetIPSecRule
Open-NetGPO
Save-NetGPO
Set-NetFirewallRule
Set-NetIPSecRule
New-GPO

REMARKS

<

Examples


EXAMPLE 1

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


PS C:\> Set-NetFirewallInterfaceFilter –InterfaceAlias Any –InputObject $nfwInterfaceFilter

This cmdlet can be run using only the pipeline.
PS C:\> Get-FirewallRule –DisplayName "Contoso Messenger" | Get-NetFirewallInterfaceFilter | Set-NetFirewallInterfaceFilter –InterfaceAlias Any

This cmdlet can be run without using the pipeline.
PS C:\> Set-NetFirewallRule –DisplayName "Contoso Messenger" –InterfaceAlias Any



This example modifies the InterfaceAlias parameter value of a particular firewall rule.




EXAMPLE 2

PS C:\> $nfwInterfaceFilter = ( Get-NetIPsecRule –Group "Wired Rules" | Get-NetFirewallInterfaceFilter )


PS C:\> $nfwInterfaceFilterWired2 = ( Where-Object -Property { $_.InterfaceAlias –Eq "Wired2" } –InputObject $nfwInterfaceFilter )


PS C:\> Set-NetFirewallInterfaceFilter –InterfaceAlias Wired3 –InputObject $nfwInterfaceFilterWired2

This cmdlet can be run using only the pipeline.
PS C:\> Get-NetIPsecRule –Group "Wired Rules" | Get-NetFirewallInterfaceFilter | Where-Object -Property { $_.InterfaceAlias –Eq "Wired2" } |
Set-NetFirewallInterfaceFilter –InterfaceAlias Wired3



This example modifies a particular interface alias associated with all of the firewall rules in a specified group.