Set-CMWindowsFirewallPolicy
Changes settings of a Windows Firewall policy.
Syntax
Set-CMWindowsFirewallPolicy
[-Description <String>]
[-Digest <ConfigurationItem>]
[-DigestPath <String>]
[-DigestXml <String>]
[-DomainBlockAllInboundTraffic <SettingType>]
[-DomainNotification <SettingType>]
[-DomainTurnOnFirewall <SettingType>]
[-InputObject] <IResultObject>
[-NewName <String>]
[-PrivateBlockAllInboundTraffic <SettingType>]
[-PrivateNotification <SettingType>]
[-PrivateTurnOnFirewall <SettingType>]
[-PublicBlockAllInboundTraffic <SettingType>]
[-PublicNotification <SettingType>]
[-PublicTurnOnFirewall <SettingType>]
[-PassThru]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-CMWindowsFirewallPolicy
[-Description <String>]
[-Digest <ConfigurationItem>]
[-DigestPath <String>]
[-DigestXml <String>]
[-DomainBlockAllInboundTraffic <SettingType>]
[-DomainNotification <SettingType>]
[-DomainTurnOnFirewall <SettingType>]
[-Id] <Int32>
[-NewName <String>]
[-PrivateBlockAllInboundTraffic <SettingType>]
[-PrivateNotification <SettingType>]
[-PrivateTurnOnFirewall <SettingType>]
[-PublicBlockAllInboundTraffic <SettingType>]
[-PublicNotification <SettingType>]
[-PublicTurnOnFirewall <SettingType>]
[-PassThru]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-CMWindowsFirewallPolicy
[-Description <String>]
[-Digest <ConfigurationItem>]
[-DigestPath <String>]
[-DigestXml <String>]
[-DomainBlockAllInboundTraffic <SettingType>]
[-DomainNotification <SettingType>]
[-DomainTurnOnFirewall <SettingType>]
[-Name] <String>
[-NewName <String>]
[-PrivateBlockAllInboundTraffic <SettingType>]
[-PrivateNotification <SettingType>]
[-PrivateTurnOnFirewall <SettingType>]
[-PublicBlockAllInboundTraffic <SettingType>]
[-PublicNotification <SettingType>]
[-PublicTurnOnFirewall <SettingType>]
[-PassThru]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-CMWindowsFirewallPolicy
[-Id] <Int32>
-Order <PriorityChangeType>
[-PassThru]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-CMWindowsFirewallPolicy
[-InputObject] <IResultObject>
-Order <PriorityChangeType>
[-PassThru]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-CMWindowsFirewallPolicy
[-Name] <String>
-Order <PriorityChangeType>
[-PassThru]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-CMWindowsFirewallPolicy cmdlet changes settings of one or more Windows Firewall policies for System Center 2016 Endpoint Protection in Configuration Manager.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Decrease the priority of a Windows Firewall policy by using a name
PS XYZ:\> Set-CMWindowsFirewallPolicy -Priority Decrease -Name "WFPContoso01"
This command decreases the priority of the Windows Firewall policy named WFPContoso01.
Example 2: Decrease the priority of a Windows Firewall policy by using an ID
PS XYZ:\> Set-CMWindowsFirewallPolicy -Priority Decrease -Id "16777568"
This command decreases the priority of the Windows Firewall policy that has the ID 16777568.
Example 3: Increase the priority of a Windows Firewall policy by using an object variable
PS XYZ:\> $WFPobj=Get-CMWindowsFirewallPolicy -Id "16777568"
PS XYZ:\> Set-CMWindowsFirewallPolicy -Priority Increase -InputObject $WFPobj
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.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
Specifies a description for the Windows Firewall policy.
Type: | String |
Aliases: | LocalizedDescription |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Digest
Type: | ConfigurationItem |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DigestPath
Type: | String |
Aliases: | DesiredConfigurationDigestPath |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DigestXml
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DomainBlockAllInboundTraffic
Specifies whether the firewall blocks all incoming traffic for a domain type network location. Valid values are:
- No
- Not Configured
- Yes
Type: | SettingType |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DomainNotification
Type: | SettingType |
Aliases: | DomainNotifications |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DomainTurnOnFirewall
Specifies whether to enable Windows Firewall for domain network location. Valid values are:
- No
- Not Configured
- Yes
Type: | SettingType |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specifies an array of IDs of firewall policies.
Type: | Int32 |
Aliases: | CIId, CI_ID |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specifies a CMWindowsFirewallPolicy object. To obtain a CMWindowsFirewallPolicy object, use the Get-CMWindowsFirewallPolicy cmdlet.
Type: | IResultObject |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies an array of firewall policy names.
Type: | String |
Aliases: | LocalizedDisplayName |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NewName
Specifies a new name for the firewall policy.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Order
{{ Fill Order Description }}
Type: | PriorityChangeType |
Aliases: | Priority |
Accepted values: | Increase, Decrease |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PassThru
Add this parameter to return an object that represents the item with which you're working. By default, this cmdlet may not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PrivateBlockAllInboundTraffic
Specifies whether the firewall blocks all incoming traffic for a private network location. Valid values are:
- No
- Not Configured
- Yes
Type: | SettingType |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PrivateNotification
Type: | SettingType |
Aliases: | PrivateNotifications |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PrivateTurnOnFirewall
Specifies whether to enable Windows Firewall for a private network location. Valid values are:
- No
- Not Configured
- Yes
Type: | SettingType |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PublicBlockAllInboundTraffic
Specifies whether the firewall blocks all incoming traffic for a public network location. Valid values are:
- No
- Not Configured
- Yes
Type: | SettingType |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PublicNotification
Type: | SettingType |
Aliases: | PublicNotifications |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PublicTurnOnFirewall
Specifies whether to enable Windows Firewall for a public network location. Valid values are:
- No
- Not Configured
- Yes
Type: | SettingType |
Accepted values: | Yes, No, NotConfigured |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.DesiredConfigurationManagement.ConfigurationItem
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object