Set-NetFirewallSetting

Windows Server 2012 R2 and Windows 8.1

Set-NetFirewallSetting

Modifies the global firewall settings of the target computer.

구문

Parameter Set: Query (cdxml)
Set-NetFirewallSetting [-AllowIPsecThroughNAT <IPsecThroughNAT> ] [-AsJob] [-CertValidationLevel <CRLCheck> ] [-CimSession <CimSession[]> ] [-EnablePacketQueuing <PacketQueuing> ] [-EnableStatefulFtp <GpoBoolean> ] [-EnableStatefulPptp <GpoBoolean> ] [-Exemptions <TrafficExemption> ] [-GPOSession <String> ] [-KeyEncoding <KeyEncoding> ] [-MaxSAIdleTimeSeconds <UInt32> ] [-PassThru] [-PolicyStore <String> ] [-RemoteMachineTransportAuthorizationList <String> ] [-RemoteMachineTunnelAuthorizationList <String> ] [-RemoteUserTransportAuthorizationList <String> ] [-RemoteUserTunnelAuthorizationList <String> ] [-RequireFullAuthSupport <GpoBoolean> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: InputObject (cdxml)
Set-NetFirewallSetting -InputObject <CimInstance[]> [-AllowIPsecThroughNAT <IPsecThroughNAT> ] [-AsJob] [-CertValidationLevel <CRLCheck> ] [-CimSession <CimSession[]> ] [-EnablePacketQueuing <PacketQueuing> ] [-EnableStatefulFtp <GpoBoolean> ] [-EnableStatefulPptp <GpoBoolean> ] [-Exemptions <TrafficExemption> ] [-KeyEncoding <KeyEncoding> ] [-MaxSAIdleTimeSeconds <UInt32> ] [-PassThru] [-RemoteMachineTransportAuthorizationList <String> ] [-RemoteMachineTunnelAuthorizationList <String> ] [-RemoteUserTransportAuthorizationList <String> ] [-RemoteUserTunnelAuthorizationList <String> ] [-RequireFullAuthSupport <GpoBoolean> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




자세한 설명

The Set-NetFirewallSetting cmdlet configures properties that apply to the firewall and IPsec settings, regardless of which network profile is currently in use. This cmdlet allows the administrator to specify global firewall behavior.

매개 변수

-AllowIPsecThroughNAT<IPsecThroughNAT>

Specifies that IPsec configures a security association (SA) when one or both computers involved are behind a network address translation (NAT) device. This setting indicates on which side NAT traversal should be attempted. 이 매개 변수에 허용되는 값은 다음과 같습니다. None, Server, Both, or NotConfigured.
-- None: Specifies that an SA cannot be negotiated if the server or client computer is behind a NAT device.
-- Server: Specifies that an SA can be negotiated if only the server is on a private subnet behind a NAT device.
-- Both: Specifies that an SA can be negotiated if the client or server or both of the computers are on private subnets behind one or more NAT devices.
-- NotConfigured: Valid only when configuring a GPO. Removes the setting from the GPO, which results in the policy not changing the value on the computer when the policy is applied.
The default value is None.
When managing a GPO, the default setting is NotConfigured.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-AsJob

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-CertValidationLevel<CRLCheck>

Specifies that IPsec checks the certificates used in authentication against a certificate revocation list (CRL), and how IPsec reacts to a certificate that is found to be on a CRL.
이 매개 변수에 허용되는 값은 다음과 같습니다. None, AttemptCrlCheck, RequireCrlCheck, or NotConfigured.
-- None: Specifies that IPsec does not perform any CRL checking.
-- AttemptCrlCheck: Specifies that IPsec authentication fails only if the certificate is found to be revoked.
-- RequireCrlCheck: Specifies that IPsec authentication fails if there is any error during CRL checking, including a failure to retrieve the CRL.
-- NotConfigured: Valid only when configuring a GPO. Removes the setting from the GPO, which results in the policy not changing the value on the computer when the policy is applied.
The default value is None.
When managing a GPO, the default setting is NotConfigured.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-CimSession<CimSession[]>

원격 세션에서 또는 원격 컴퓨터에서 cmdlet을 실행합니다. New-CimSession 또는 Get-CimSession cmdlet의 출력과 같은 컴퓨터 이름이나 세션 개체를 입력합니다. 기본값은 로컬 컴퓨터의 현재 세션입니다.


별칭

Session

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-EnablePacketQueuing<PacketQueuing>

Specifies how the Windows Firewall with Advanced Security handles packet queuing.
This parameter enables inbound or forward packet queuing independently, allowing the computer is able to evenly distribute CPU load to multiple CPUs for site-to-site IPsec tunnel scenarios. 이 매개 변수에 허용되는 값은 다음과 같습니다. None, Inbound, Forward, or NotConfigured.
-- None: The firewall tracks the port numbers specified in PORT command requests and in the responses to PASV requests, and then allows the incoming FTP data traffic entering on the requested port number.
-- Inbound: Inbound packet queuing is enabled.
-- Forward: Forward packet queuing is enabled.
-- NotConfigured: Valid only when configuring a GPO. Removes the setting from the GPO, which results in the policy not changing the value on the computer when the policy is applied.
The default value when managing a computer running Windows Server® 2012 is None.
When managing a Group Policy Object (GPO), the default setting is NotConfigured.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-EnableStatefulFtp<GpoBoolean>

Configures how Windows Firewall with Advanced Security handles FTP traffic that uses an initial connection on one port to request a data connection on a different port. This affects both active and passive FTP.
If active FTP is used, then the client initiates a connection to the server on TCP port 21 and includes a PORT command that indicates to the FTP server the port number on which it should respond. A typical firewall on the client would block this new connection as unsolicited inbound traffic since the packets to the new port are not in response to a request from that port.
If passive FTP is used, then the client initiates a connection to the server on TCP port 21 and includes the PASV command. The server responds on TCP port 21 with a port number that the client must use for subsequent data transfer. The client then initiates a connection to the server on the specified port. A typical firewall on the FTP server would block this new incoming data connection as unsolicited inbound traffic since the packets received at the new port are not in response to a request from that port.
When this parameter is True, the firewall examines the PORT and PASV requests for these other port numbers and then allows the corresponding data connection to the port number that was requested.
-- True: The firewall tracks the port numbers specified in PORT command requests and in the responses to PASV requests, and then allows the incoming FTP data traffic entering on the requested port number.
-- False: The firewall does not track outgoing PORT commands or PASV responses, and so incoming data connections on the PORT or PASV requested port is blocked as an unsolicited incoming connection.
- NotConfigured: Valid only when configuring a GPO. Removes the setting from the GPO, which results in the policy not changing the value on the computer when the policy is applied.
The default value is False.
The default value when managing a computer running or is True.
The default value when managing a computer running or is False.
When managing a Group Policy Object (GPO), the default value is NotConfigured.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-EnableStatefulPptp<GpoBoolean>

Configures how Windows Firewall with Advanced Security handles PPTP traffic.
If a connection is made through TCP port 1723 in , then Windows Firewall recognizes the connection as being established through PPTP. By default, Windows Firewall uses a stateful PPTP protocol analyzer to determine whether it can receive packets through the TCP port 1723 connection. Therefore, the stateful PPTP protocol analyzer may reject as not valid any traffic that uses a protocol other than PPTP.
-- True: The firewall examines the packets from port 1723 and determines whether the traffic is valid PPTP traffic.
-- False: The firewall does not examine the packets from port 1723 to determine whether the traffic is valid PPTP traffic.
-- NotConfigured: Valid only when configuring a GPO. Removes the setting from the GPO, which results in the policy not changing the value on the computer when the policy is applied.
The default value is False.
When managing a GPO, the default value is NotConfigured.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Exemptions<TrafficExemption>

Specifies the protocols to be exempted from IPsec requirements.
이 매개 변수에 허용되는 값은 다음과 같습니다. None, NeighborDiscovery, Icmp, RouterDiscovery, Dhcp, or NotConfigured.
-- None: No protocols are exempted.
-- NeighborDiscovery: Exempt IPv6 Neighbor Discovery protocol traffic.
-- Icmp: Exempt ICMP, for both IPv4 and IPv6, protocol traffic. This option is available on computers that are running Windows® 7 or Windows Server 2008 R2.
-- RouterDiscovery: Exempt router discovery traffic.
-- Dhcp: Exempt DHCP, for both IPv4 and IPv6, protocol traffic. This option is available on computers that are running Windows® 7 or Windows Server 2008 R2.
The default value when managing a local computer that is running Windows® 7 or Windows Server 2008 R2 is NeighborDiscovery,Dhcp.
The default value when managing a local computer that is running , , Windows XP®, or Windows Server® 2003 is NeighborDiscovery.
The default value when managing a GPO is NotConfigured.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-GPOSession<String>

Specifies the network GPO from which to retrieve the rules to be modified.
This parameter is used in the same way as the PolicyStore parameter. When modifying GPOs in Windows PowerShell®, each change to a GPO requires the entire GPO to be loaded, modified, and saved back. On a busy Domain Controller (DC), this can be a slow and resource-heavy operation. A GPO Session loads a domain GPO onto the local computer and makes all changes in a batch, before saving it back. This reduces the load on the DC and speeds up the Windows PowerShell cmdlets. To load a GPO Session, use the Open-NetGPO cmdlet. To save a GPO Session, use the Save-NetGPO cmdlet.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-InputObject<CimInstance[]>

이 cmdlet에 대한 입력을 지정합니다. 이 매개 변수를 사용하거나 입력을 이 cmdlet으로 파이프할 수 있습니다.


별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByValue)

와일드카드 문자 허용 여부

false

-KeyEncoding<KeyEncoding>

Specifies the type of key encoding to be used.
이 매개 변수에 허용되는 값은 다음과 같습니다. UTF16 or UTF8.
The default value is UTF8.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-MaxSAIdleTimeSeconds<UInt32>

Specifies the number of minutes that a security association (SA) can stay idle before being deleted.
Once deleted, a new SA must be established before computers under the scope of the original SA can communicate again.
이 매개 변수에 허용되는 값은 다음과 같습니다. 300 through 3600 seconds, or NotConfigured.
-- A non-zero value, including 300 through 3600, specifies the desired lifetime.
-- NotConfigured: Valid only when configuring a GPO. Removes the setting from the GPO, which results in the policy not changing the value on the computer when the policy is applied. Note: This parameter value is case-sensitive and NotConfigured can only be specified using dot-notation.
The default value when managing a local computer is 300 seconds (5 minutes).
When managing a GPO, the default value is NotConfigured.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-PassThru

작업하고 있는 항목을 나타내는 개체를 반환합니다. 기본적으로 이 cmdlet은 출력을 생성하지 않습니다.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-PolicyStore<String>

Specifies the policy store from which to retrieve the rules to be modified.
A policy store is a container for firewall and IPsec policy.
이 매개 변수에 허용되는 값은 다음과 같습니다.
-- PersistentStore: Sometimes called static rules, this store contains the persistent policy for the local computer. This policy is not from GPOs, and has been created manually or programmatically (during application installation) on the computer. Rules created in this store are attached to the ActiveStore and activated on the computer immediately.
-- ActiveStore: This store contains the currently active policy, which is the sum of all policy stores that apply to the computer. This is the resultant set of policy (RSOP) for the local computer (the sum of all GPOs that apply to the computer), and the local stores (the PersistentStore, the static Windows service hardening (WSH), and the configurable WSH).
---- GPOs are also policy stores. Computer GPOs can be specified as follows.
------ –PolicyStore hostname.
---- Active Directory GPOs can be specified as follows.
------ –PolicyStore domain.fqdn.com\GPO_Friendly_Namedomain.fqdn.comGPO_Friendly_Name.
------ Such as the following.
-------- -PolicyStore localhost
-------- -PolicyStore corp.contoso.com\FirewallPolicy
---- Active Directory GPOs can be created using the New-GPO cmdlet or the Group Policy Management Console.
-- RSOP: This read-only store contains the sum of all GPOs applied to the local computer.
-- SystemDefaults: This read-only store contains the default state of firewall rules that ship with Windows Server 2012.
-- StaticServiceStore: This read-only store contains all the service restrictions that ship with Windows Server 2012. Optional and product-dependent features are considered part of Windows Server 2012 for the purposes of WFAS.
-- ConfigurableServiceStore: This read-write store contains all the service restrictions that are added for third-party services. In addition, network isolation rules that are created for Windows Store application containers will appear in this policy store.
The default value is PersistentStore.
Note: The Set-NetFirewallRule cmdlet cannot be used to add an object to a policy store. An object can only be added to a policy store at creation time with the Copy-NetFirewallRule cmdlet or with the New-NetFirewallRule cmdlet.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-RemoteMachineTransportAuthorizationList<String>

Specifies the computer accounts that are authorized to establish transport connections to the local computer that match this rule. Authorization can override the per-rule basis and be done at the IPsec layer. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- None: Specifies that access to the tunnel is not restricted based on computer account.
-- <SDDL string>: A string that identifies accounts and the permissions granted or denied to those accounts.
This parameter value is valid on computers that are running Windows® 7, Windows Server 2008 R2, and Windows Server 2012 only, and is ignored on earlier versions of Windows.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-RemoteMachineTunnelAuthorizationList<String>

Specifies the computer accounts that are authorized to establish tunnel connections to the local computer that match this rule. Authorization can override the per-rule basis and be done at the IPsec layer. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- None: Specifies that access to the tunnel is not restricted based on computer account.
-- <SDDL string>: A string that identifies accounts and the permissions granted or denied to those accounts.
This parameter value is valid on computers that are running Windows® 7, Windows Server 2008 R2, and Windows Server 2012 only, and is ignored on earlier versions of Windows.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-RemoteUserTransportAuthorizationList<String>

Specifies the user accounts that are authorized to establish transport connections to the local computer that match this rule. Authorization can override the per-rule basis and be done at the IPsec layer. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- None: Specifies that access to the tunnel is not restricted based on computer account.
-- <SDDL string>: A string that identifies accounts and the permissions granted or denied to those accounts.
This parameter value is valid on computers that are running Windows® 7, Windows Server 2008 R2, and Windows Server 2012 only, and is ignored on earlier versions of Windows.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-RemoteUserTunnelAuthorizationList<String>

Specifies the user accounts that are authorized to establish tunnel connections to the local computer that match this rule. Authorization can override the per-rule basis and be done at the IPsec layer. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- None: Specifies that access to the tunnel is not restricted based on computer account.
-- <SDDL string>: A string that identifies accounts and the permissions granted or denied to those accounts.
This parameter value is valid on computers that are running Windows® 7, Windows Server 2008 R2, and Windows Server 2012 only, and is ignored on earlier versions of Windows.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-RequireFullAuthSupport<GpoBoolean>

Ignores key modules that do not support all of the authentication types present in a rule. If this parameter is set to True, then the behavior is the same as and Windows® 7, that the key modules that do not support the entire authentication set will be ignored. If this parameter is set to False, then the keying modules will try with the subset of configured authentication types that are allowed.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-ThrottleLimit<Int32>

이 cmdlet을 실행하도록 설정할 수 있는 최대 동시 작업 수를 지정합니다. 이 매개 변수가 생략되거나 값 0이 입력되면 Windows PowerShell®은 컴퓨터에서 실행 중인 CIM cmdlet의 수에 따라 cmdlet에 대한 최적의 제한 한도를 계산합니다. 제한 한도는 현재 cmdlet에만 적용되며 세션이나 컴퓨터에는 적용되지 않습니다.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.


필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.


필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(http://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • Microsoft.Management.Infrastructure.CimInstance#root\StandardCimv2\NetFirewallSetting[]

    Microsoft.Management.Infrastructure.CimInstance 개체는 WMI(Windows Management Instrumentation) 개체를 표시하는 래퍼 클래스입니다. 파운드 기호(#) 뒤에 오는 경로는 기본 WMI 개체의 네임스페이스 및 클래스 이름을 제공합니다.


출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • Microsoft.Management.Infrastructure.CimInstance#root\StandardCimv2\MSFT_NetServiceFilter[]

    Microsoft.Management.Infrastructure.CimInstance 개체는 WMI(Windows Management Instrumentation) 개체를 표시하는 래퍼 클래스입니다. 파운드 기호(#) 뒤에 오는 경로는 기본 WMI 개체의 네임스페이스 및 클래스 이름을 제공합니다.


예제

EXAMPLE 1

This example modifies the global firewall settings of a particular GPO policy store.


 

PS C:\> $nfSetting = Get-NetFirewallSetting –PolicyStore corp.contoso.com/gpo_name

 

PS C:\> Set-NetFirewallSetting -Exemptions RouterDiscovery -InputObject $nfSetting

 

This cmdlet can be run using only the pipeline.


PS C:\> Get-NetFirewallSetting –PolicyStore corp.contoso.com/gpo_name | Set-NetFirewallSetting -Exemptions RouterDiscovery

EXAMPLE 2

This example allows authorization to override the per-rule basis and to be done at the IPsec layer in a GPO.


 

PS C:\> $computers = New-Object –Typename System.Security.Principal.NTAccount ("corp.contoso.com" "SecureMachineName1")

 

PS C:\> $SIDofSecureComputerGroup = $computers.Translate([System.Security.Principal.SecurityIdentifier]).Value

 

PS C:\> $SecureMachineGroupSDDL = "D:(A;;CC;;; $SIDofSecureComputerGroup)"

 

PS C:\> $nfSetting = Get-NetFirewallSetting –PolicyStore corp.contoso.com/gpo_name

 

PS C:\> Set-NetFirewallSetting –RemoteMachineTunnelAuthorizationList $SecureMachineGroupSDDL –InputObject $nfSetting

 

This cmdlet can be run using only the pipeline.


PS C:\> Get-NetFirewallSetting –PolicyStore corp.contoso.com/gpo_name | Set-NetFirewallSetting –RemoteMachineTunnelAuthorizationList $SecureMachineGroupSDDL

관련 항목

커뮤니티 추가 항목

추가
표시: