Set-CMWindowsFirewallPolicy

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Set-CMWindowsFirewallPolicy

Changes settings of a Windows Firewall policy.

Syntax

Parameter Set: SetByID
Set-CMWindowsFirewallPolicy [-Priority <PriorityChangeType> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByName
Set-CMWindowsFirewallPolicy -Name <String[]> [-Priority <PriorityChangeType> ] [-SecuredScopeNames <String[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByValue
Set-CMWindowsFirewallPolicy -InputObject <IResultObject> [-Priority <PriorityChangeType> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

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

Parameters

-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

-Priority<PriorityChangeType>

Sets the priority of a firewall policy. Valid values are Increase and Decrease.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecuredScopeNames<String[]>

Specifies an array of security scope names. A security scope name can be Default or the name of a custom-created security scope.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

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.

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

In this example, the first command gets the CMWindowsFirewallPolicy object that has the ID 16777568 and stores it in the $WFPobj variable.

The second command decreases 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

Remove-CMWindowsFirewallPolicy