New-CMWindowsFirewallPolicy

Creates a new Windows Firewall policy in Configuration Manager.

Syntax

New-CMWindowsFirewallPolicy
   [-Description <String>]
   [-DomainBlockAllInboundTraffic <SettingType>]
   [-DomainNotification <SettingType>]
   [-DomainTurnOnFirewall <SettingType>]
   -Name <String>
   [-PrivateBlockAllInboundTraffic <SettingType>]
   [-PrivateNotification <SettingType>]
   [-PrivateTurnOnFirewall <SettingType>]
   [-PublicBlockAllInboundTraffic <SettingType>]
   [-PublicNotification <SettingType>]
   [-PublicTurnOnFirewall <SettingType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-CMWindowsFirewallPolicy cmdlet creates a configuration policy for Windows Firewall in Configuration Manager.

Windows Firewall allows or denies incoming connections to an IP address. The blocking actions allow or deny incoming traffic based on a network location type. The network location types are: domain, public, and private.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Create a Windows Firewall policy

PS XYZ:\> New-CMWindowsFirewallPolicy -Name "test01" -Description "323132" -DomainTurnOnFirewall Yes -PrivateTurnOnFirewall Yes -PublicTurnOnFirewall Yes

This command creates a new Windows Firewall policy and enables the firewall for domain, private, and public network location types.

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 firewall policy.

Type:String
Aliases:LocalizedDescription
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 to block all incoming traffic for a domain type of network location.The acceptable values for this parameter 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 turn on a firewall for a domain type of network location. The acceptable values for this parameter 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

-Name

Specifies a name for the firewall policy in Configuration Manager.

Type:String
Aliases:LocalizedDisplayName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PrivateBlockAllInboundTraffic

Specifies whether to block all incoming traffic for a private type of network location. The acceptable values for this parameter 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 turn on a firewall for a private type of network location. The acceptable values for this parameter 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 to block all incoming traffic for a public type of network location. The acceptable values for this parameter 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. The acceptable values for this parameter 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

None

Outputs

IResultObject