New-CMWindowsFirewallPolicy

Creates a new Windows Firewall policy in Configuration Manager.

Syntax

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

Description

The New-CMWindowsFirewallPolicy cmdlet creates a configuration policy for Windows Firewall in Microsoft System Center 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.

Examples

Example 1: Create a Windows Firewall policy

PS C:\> 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.

Required Parameters

-Name

Specifies a name for the firewall policy in Configuration Manager.

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies a description for the firewall policy.

Type:String
Aliases:LocalizedDescription
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
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
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DomainNotification
Type:SettingType
Aliases:DomainNotifications
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
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
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
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
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrivateNotification
Type:SettingType
Aliases:PrivateNotifications
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
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
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
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
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PublicNotification
Type:SettingType
Aliases:PublicNotifications
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
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
Parameter Sets:Yes, No, NotConfigured
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False