PowerShell Logo Small

Get-NetFirewallAddressFilter



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

Retrieves address filter objects from the target computer.

SYNTAX


Get-NetFirewallAddressFilter [-All] [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PolicyStore <String>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Get-NetFirewallAddressFilter [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PolicyStore <String>] [-ThrottleLimit <Int32>] -AssociatedNetFirewallRule
<CimInstance> [<CommonParameters>]
Get-NetFirewallAddressFilter [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PolicyStore <String>] [-ThrottleLimit <Int32>] -AssociatedNetIPsecMainModeRule
<CimInstance> [<CommonParameters>]
Get-NetFirewallAddressFilter [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PolicyStore <String>] [-ThrottleLimit <Int32>] -AssociatedNetIPsecRule
<CimInstance> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-NetFirewallAddressFilter cmdlet returns address filter objects associated with the input rules.


Address filter objects represent the local and remote addresses associated with the input rules. The LocalAddress and RemoteAddress parameters of a single rule are
represented in a separate NetFirewallAddressFilter object. The filter-to-rule relationship is always one-to-one and is managed automatically. Rule parameters associated with
filters can only be queried using filter objects.


This cmdlet retrieves the addresses associated with firewall, IPsec, and IPsec main-mode rules. This allows for rule querying based on address fields using the LocalAddress
or RemoteAddress parameters; this cmdlet returns filter objects that may be further queried with the Where-Object cmdlet. The resultant filters are passed to the
Get-NetFirewallRule, Get-NetIPsecRule, or Get-NetIPsecMainModeRule cmdlet to return the rules queried by address.


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

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

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



<

RELATED LINKS

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

REMARKS

<

Examples


EXAMPLE 1

PS C:\>Get-NetIPsecRule –PolicyStore ActiveStore


This cmdlet shows the same information in a dynamically-sized, formatted table.
PS C:\>Get-NetIPsecRule –PolicyStore ActiveStore | Format-Table



This example retrieves the addresses associated with all the rules in the active store. Note: Running this cmdlet without specifying the policy store retrieves the
persistent store.




EXAMPLE 2

PS C:\>Get-NetFirewallRule –DisplayGroup "Core Networking" | Get-NetFirewallAddressFilter | Where-Object –FilterScript { $_.RemoteAddress –Eq "LocalSubnet6" }



This example gets the address configurations associated with a particular IPsec rule.




EXAMPLE 3

PS C:\>Get-NetFirewallRule –DisplayGroup "Core Networking" | Get-NetFirewallAddressFilter | Where-Object –FilterScript { $_.RemoteAddress –Eq "LocalSubnet6" } |
Set-NetFirewallAddressFilter –RemoteAddress LocalSubnet4


This is an alternate method with this cmdlet.
PS C:\>Get-NetFirewallRule –DisplayGroup "Core Networking" | Get-NetFirewallAddressFilter | Where-Object –FilterScript { $_.RemoteAddress –Eq "LocalSubnet6" } |
Get-NetFirewallRule | Set-NetFirewalllRule -RemoteAddress LocalSubnet4



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