PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Set-NetEventSession', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Modifies a network event session.


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

Search powershellhelp.space


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.



Online Version: http://go.microsoft.com/fwlink/?LinkID=294404




Example 1: Modify the file path for a session

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

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.