PowerShell Logo Small

Set-NetFirewallAddressFilter



This is the built-in help made by Microsoft for the command 'Set-NetFirewallAddressFilter', 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

Modifies address filter objects, thereby modifying the local and remote address conditions of the firewall, IPsec, and main mode rules.

SYNTAX


Set-NetFirewallAddressFilter [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-LocalAddress <String[]>] [-PassThru] [-PolicyStore <String>] [-RemoteAddress
<String[]>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-NetFirewallAddressFilter [-AsJob] [-CimSession <CimSession[]>] [-LocalAddress <String[]>] [-PassThru] [-RemoteAddress <String[]>] [-ThrottleLimit <Int32>] -InputObject
<CimInstance[]> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-NetFirewallAddressFilter cmdlet modifies the local and remote addresses associated with the input rules.


See the Get-NetFirewallAddressFilter cmdlet for more information on address filters.


To modify rule address conditions, two methods can be used starting with the address filters returned by the Get-NetFirewallAddressFilter cmdlet and optional additional
querying.

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

Alternatively, piping the address filter objects directly to this cmdlet allows the LocalAddress and RemoteAddress parameters of the rules to be specified.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=288210
Where-Object
Copy-NetIPsecRule
Get-NetFirewallAddressFilter
Get-NetFirewallRule
Get-NetIPsecMainModeRule
Get-NetIPSecRule
New-NetFirewallRule
New-NetIPSecRule
Open-NetGPO
Save-NetGPO
Set-NetFirewallRule
Get-NetIPsecMainModeRule
Set-NetIPSecRule
New-GPO

REMARKS

<

Examples


EXAMPLE 1

PS C:\>Set-NetIPsecRule –DisplayName "Tunnel Rule" -LocalAddress Any


This task can be alternatively done with the following cmdlets.
PS C:\>$nfwAddressFilter = ( Get-NetIPsecRule –DisplayName "Tunnel Rule" | Get-NetFirewallAddressFilter )



PS C:\>Set-NetFirewallAddressFilter -InputObject $nfwAddressFilter –LocalAddress Any


This task can be alternatively done with the following cmdlet.
PS C:\>Get-NetIPsecRule –DisplayName "Tunnel Rule" | Get-NetFirewallAddressFilter | Set-NetFirewallAddressFilter –LocalAddress Any



This example changes the first end point of a particular IPsec rule.




EXAMPLE 2

PS C:\>$nfwAddressFilter = ( Get-NetFirewallRule –DisplayGroup "Core Networking" | Get-NetFirewallAddressFilter )



PS C:\>$nfwAddressFilterLS6 = ( Where-Object –InputObject $nfwAddressFilter –Property { $_.RemoteAddress –Eq "LocalSubnet6" } )



PS C:\>Set-NetFirewallAddressFilter –InputObject $nfwAddressFilterLS6 –RemoteAddress LocalSubnet4


This task can be alternatively done with the following cmdlet.
PS C:\>Get-NetFirewallRule –DisplayGroup "Core Networking" | Get-NetFirewallAddressFilter | Where-Object –Property { $_.RemoteAddress –Eq "LocalSubnet6" } |
Get-NetFirewallRule | Set-NetFirewalllRule -RemoteAddress LocalSubnet4



This example gets the filter objects associated with the firewall rules with a particular remote, or second, end point belonging to the Core Networking group and modifies
the second endpoint of those rules.