Set-NetEventSession

Set-NetEventSession

Modifies a network event session.

구문

Parameter Set: ByName
Set-NetEventSession [[-Name] <String[]> ] [-CaptureMode <CaptureModes> {RealtimeRPC | SaveToFile | RealtimeLocal} ] [-CimSession <CimSession[]> ] [-LocalFilePath <String> ] [-MaxFileSize <UInt32> ] [-MaxNumberOfBuffers <Byte> ] [-PassThru] [-ThrottleLimit <Int32> ] [-TraceBufferSize <UInt32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByProviderOfSession
Set-NetEventSession [-AssociatedEventProvider <CimInstance> ] [-CaptureMode <CaptureModes> {RealtimeRPC | SaveToFile | RealtimeLocal} ] [-CimSession <CimSession[]> ] [-LocalFilePath <String> ] [-MaxFileSize <UInt32> ] [-MaxNumberOfBuffers <Byte> ] [-PassThru] [-ThrottleLimit <Int32> ] [-TraceBufferSize <UInt32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: InputObject (cdxml)
Set-NetEventSession [-CaptureMode <CaptureModes> {RealtimeRPC | SaveToFile | RealtimeLocal} ] [-CimSession <CimSession[]> ] [-LocalFilePath <String> ] [-MaxFileSize <UInt32> ] [-MaxNumberOfBuffers <Byte> ] [-PassThru] [-ThrottleLimit <Int32> ] [-TraceBufferSize <UInt32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]

자세한 설명

The Set-NetEventSession cmdlet modifies a network event session. A session controls how the computer logs events and, optionally, network traffic, or packets. A session requires at least one network event provider for logging. A network event provider logs events and network traffic as Event Tracing for Windows (ETW) events. The session stores these events in an .etl file or provides them to an application that displays them.

Specify a session to modify by using its name, or get a session to modify by using the Get-NetEventSession cmdlet. You can remove a session by using the Remove-NetEventSession cmdlet. Use the New-NetEventSession cmdlet to create a session. Only one session can exist at a time.

You can modify the maximum number of buffers in a session and the size of the trace buffer.

You can also modify whether to use an.etl file and, if you do, specify its location and maximum size. Instead of an .etl file, you can select a type of live display.

Use the Start-NetEventSession and Stop-NetEventSession cmdlets to start and stop logging. If you make changes to a session that is currently running, you must stop and restart the session for your changes to take effect.

매개 변수

-AssociatedEventProvider<CimInstance>

Specifies the associated network event provider as a CIM object. To obtain the network event provider, use the Get-NetEventProvider cmdlet.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

True (ByValue)

와일드카드 문자 허용 여부

false

-CaptureMode<CaptureModes>

Specifies a capture mode. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- SaveToFile. Saves the capture to an .etl file.
-- RealtimeRPC. Connects remotely for a live event and packet capture.
-- RealtimeLocal. Connects locally for a live event and packet capture.

If you specify a value of SaveToFile, you can specify a location for the file by using the LocalFilePath parameter and specify a maximum file size by using the MaxFileSize parameter.

If you specify a value of RealtimeRPC or RealtimeLocal, the capture requires additional software, such as Microsoft Message Analyzer.

별칭

cm

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-CimSession<CimSession[]>

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

별칭

Session

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-LocalFilePath<String>

Specifies a file path. If you specify a value of SaveToFile for the CaptureMode parameter, the cmdlet saves the file to this location. Be sure that you can write to this location. If you do not specify this parameter, the cmdlet uses the default value of %LocalAppData%\Temp\NetTrace.etl.

별칭

lfp

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-MaxFileSize<UInt32>

Specifies a maximum file size, in megabytes. If you specify a value of SaveToFile for the CaptureMode parameter, this value is the maximum size for the .etl file. Once the file reaches the maximum, the session continues to save events, and discards the oldest events to make room. A value of 0 means that there is no maximum. If you do not specify this parameter, the cmdlet uses a default value of 250.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-MaxNumberOfBuffers<Byte>

Specifies the maximum number of buffers used in a session. If the computer determines that the value restricts performance or the value is 0, the computer overrides the configuration to optimize trace performance. For more information, see EVENT_TRACE_PROPERTIES structure (https://msdn.microsoft.com/en-us/library/windows/desktop/aa363784(v=vs.85).aspx) In the Microsoft Developer Network library.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Name<String[]>

Specifies an array of names of sessions to modify.

별칭

none

필수 여부

false

위치

1

기본값

none

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-PassThru

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

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-ThrottleLimit<Int32>

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

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-TraceBufferSize<UInt32>

Specifies the amount of memory, in kilobytes, for a buffer for event tracing. The maximum value is 1024. If the computer determines that the value restricts performance or the value is 0, the computer overrides the configuration to optimize trace performance. The ETW logger uses the size of physical memory to calculate the default value.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 적용 여부

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(https://go.microsoft.com/fwlink/p/?LinkID=113216).

<WorkflowParameters>

이 cmdlet은 다음 워크플로 일반 매개 변수 -PSParameterCollection, -PSComputerName, -PSCredential, -PSConnectionRetryCount, -PSConnectionRetryIntervalSec, -PSRunningTimeoutSec, -PSElapsedTimeoutSec, -PSPersist, -PSAuthentication, -PSAuthenticationLevel, -PSApplicationName, -PSPort, -PSUseSSL, -PSConfigurationName, -PSConnectionURI, -PSAllowRedirection, -PSSessionOption, -PSCertificateThumbprint, -PSPrivateMetadata, -AsJob, -JobName, –InputObject를 지원합니다. 자세한 내용은 다음을 참조하세요.  about_WorkflowCommonParameters.

입력

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

출력

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

예제

Example 1: Modify the file path for a session

This command modifies the file path for the network event session on the current computer. The new path is C:\WINDOWS\Temp\Trace.etl. If you make changes to a session that is currently running, use the Stop-NetEventSession and Start-NetEventSession cmdlets to stop and restart logging.

PS C:\> Set-NetEventSession -LocalFilePath 'C:\WINDOWS\Temp\Trace.etl'

관련 항목

Get-NetEventSession

New-NetEventSession

Remove-NetEventSession

Start-NetEventSession

Stop-NetEventSession

Get-NetEventProvider