Set-CMWindowsFirewallPolicy

Set-CMWindowsFirewallPolicy

Changes settings of a Windows Firewall policy.

Syntax

Parameter Set: SearchByNameMandatory
Set-CMWindowsFirewallPolicy -Name <String[]> [-Description <String> ] [-DomainBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-DomainNotifications <SettingType> {No | NotConfigured | Yes} ] [-DomainTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-NewName <String> ] [-PrivateBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-PrivateNotifications <SettingType> {No | NotConfigured | Yes} ] [-PrivateTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-PublicBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-PublicNotifications <SettingType> {No | NotConfigured | Yes} ] [-PublicTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByIdMandatory
Set-CMWindowsFirewallPolicy -Id <String[]> [-Description <String> ] [-DomainBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-DomainNotifications <SettingType> {No | NotConfigured | Yes} ] [-DomainTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-NewName <String> ] [-PrivateBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-PrivateNotifications <SettingType> {No | NotConfigured | Yes} ] [-PrivateTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-PublicBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-PublicNotifications <SettingType> {No | NotConfigured | Yes} ] [-PublicTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Set-CMWindowsFirewallPolicy -InputObject <IResultObject> [-Description <String> ] [-DomainBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-DomainNotifications <SettingType> {No | NotConfigured | Yes} ] [-DomainTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-NewName <String> ] [-PrivateBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-PrivateNotifications <SettingType> {No | NotConfigured | Yes} ] [-PrivateTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-PublicBlockAllInboundTraffic <SettingType> {No | NotConfigured | Yes} ] [-PublicNotifications <SettingType> {No | NotConfigured | Yes} ] [-PublicTurnOnFirewall <SettingType> {No | NotConfigured | Yes} ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetById
Set-CMWindowsFirewallPolicy -Id <String[]> -Priority <PriorityChangeType> {Decrease | Increase} [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByName
Set-CMWindowsFirewallPolicy -Name <String[]> -Priority <PriorityChangeType> {Decrease | Increase} [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByValue
Set-CMWindowsFirewallPolicy -InputObject <IResultObject> -Priority <PriorityChangeType> {Decrease | Increase} [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-CMWindowsFirewallPolicy cmdlet changes settings of one or more Windows Firewall policies for System Center 2012 Endpoint Protection in Microsoft System Center 2012 SP1 Configuration Manager.

Parameters

-Description<String>

Specifies a description for the Windows Firewall policy.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DomainBlockAllInboundTraffic<SettingType>

Specifies whether the firewall blocks all incoming traffic for a domain type network location. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DomainNotifications<SettingType>

Specifies whether Configuration Manager sends notifications to domain type network locations. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DomainTurnOnFirewall<SettingType>

Specifies whether to enable Windows Firewall for domain network location. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of IDs of firewall policies.

Aliases

CIId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies a CMWindowsFirewallPolicy object. To obtain a CMWindowsFirewallPolicy object, use the Get-CMWindowsFirewallPolicy cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String[]>

Specifies an array of firewall policy names.

Aliases

LocalizedDisplayName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NewName<String>

Specifies a new name for the firewall policy.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Priority<PriorityChangeType>

Specifies the priority of a firewall policy. The acceptable values for this parameter are: Increase and Decrease.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PrivateBlockAllInboundTraffic<SettingType>

Specifies whether the firewall blocks all incoming traffic for a private network location. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PrivateNotifications<SettingType>

Specifies whether Configuration Manager sends notifications to private network locations. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PrivateTurnOnFirewall<SettingType>

Specifies whether to enable Windows Firewall for a private network location. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PublicBlockAllInboundTraffic<SettingType>

Specifies whether the firewall blocks all incoming traffic for a public network location. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PublicNotifications<SettingType>

Specifies whether Configuration Manager sends notifications to public network locations. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PublicTurnOnFirewall<SettingType>

Specifies whether to enable Windows Firewall for a public network location. The acceptable values for this parameter are:

-- No
-- Not Configured
-- Yes

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Decrease the priority of a Windows Firewall policy by using a name

This command decreases the priority of the Windows Firewall policy named WFPContoso01.

PS C:\> Set-CMWindowsFirewallPolicy -Priority Decrease -Name "WFPContoso01"

Example 2: Decrease the priority of a Windows Firewall policy by using an ID

This command decreases the priority of the Windows Firewall policy that has the ID 16777568.

PS C:\> Set-CMWindowsFirewallPolicy -Priority Decrease -Id "16777568"

Example 3: Increase the priority of a Windows Firewall policy by using an object variable

The first command gets the CMWindowsFirewallPolicy object that has the ID 16777568 and stores it in the $WFPobj variable.

The second command increases the priority of the Windows Firewall policy stored in the $WFPobj variable.

PS C:\> $WFPobj=Get-CMWindowsFirewallPolicy -Id "16777568"
PS C:\> Set-CMWindowsFirewallPolicy -Priority Increase -InputObject $WFPobj

Get-CMWindowsFirewallPolicy

New-CMWindowsFirewallPolicy

Remove-CMWindowsFirewallPolicy