PowerShell Logo Small

Set-NetFirewallServiceFilter



This is the built-in help made by Microsoft for the command 'Set-NetFirewallServiceFilter', 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 service filter objects, thereby modifying the service conditions of the firewall rules.

SYNTAX


Set-NetFirewallServiceFilter [-AsJob] [-CimSession <CimSession[]>] [-GPOSession <String>] [-PassThru] [-PolicyStore <String>] [-Service <String>] [-ThrottleLimit <Int32>]
[-Confirm] [-WhatIf] [<CommonParameters>]
Set-NetFirewallServiceFilter [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-Service <String>] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [-Confirm] [-WhatIf]
[<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-NetFirewallServiceFilter cmdlet modifies the service conditions associated with the input firewall rules.


See the Get-NetFirewallServiceFilter cmdlet for more information on the security filters.


To modify the service conditions, two methods can be used starting with the service filters returned by Get-NetFirewallServiceFilter cmdlet.

-- The network firewall service filter objects can be piped into the Get-NetFirewallRule cmdlet. The Get-NetFirewallRule cmdlet returns the rules associated with the
filters and piped the rules into the Set-NetFirewallRule cmdlet, which configures the service properties.

-- Alternatively, piping the network firewall service filter objects directly to this cmdlet modifies the Service parameter of the rules.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=288367
Copy-NetIPsecRule
Get-NetFirewallRule
Get-NetFirewallServiceFilter
Get-NetIPSecRule
New-NetFirewallRule
New-NetIPSecRule
Open-NetGPO
Save-NetGPO
Set-NetFirewallRule
Set-NetIPSecRule
New-GPO

REMARKS

<

Examples


EXAMPLE 1

PS C:\>$nfServiceFilter = Get-FirewallRule –DisplayName "Wireless Portable Devices" | Get-NetFirewallServiceFilter



PS C:\>Set-NetFirewallServiceFilter –Service Any –InputObject $nfServiceFilter


This cmdlet can be run using only the pipeline.
PS C:\>Get-FirewallRule –DisplayName "Wireless Portable Devices" | Get-NetFirewallServiceFilter | Set-NetFirewallServiceFilter –Service Any


This cmdlet can be run without the pipeline.
PS C:\>Set-NetFirewallRule –DisplayName “Wireless Portable Devices” –Service Any



This example modifies the user field of a particular firewall rule.




EXAMPLE 2

PS C:\>$nfServiceFilter = Get-NetFirewallRule –Group "@FirewallAPI.dll,-30502" | Get-NetFirewallServiceFilter -Service Any



PS C:\>Set-NetFirewallServiceFilter –Service Ssdpsrv –InputObject $nfServiceFilter


This cmdlet can be run using only the pipeline.
PS C:\>Get-NetFirewallRule –Group "@FirewallAPI.dll,-30502" | Get-NetFirewallServiceFilter -Service Any | Set-NetFirewallServiceFilter –Service Ssdpsrv



This example modifies the service associated with firewall rules in a specified group.