Created
March 22, 2020 10:27
-
-
Save PshMike/d8c94fc8788898df667637454c6229e4 to your computer and use it in GitHub Desktop.
Packet Capture using PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cs = New-CimSession -ComputerName SERVER001 | |
New-NetEventSession -CimSession $cs -Name mycap -LocalFilePath c:\temp\netcapture.etl | |
Add-NetEventPacketCaptureProvider -CimSession $cs -SessionName mycap | |
Start-NetEventSession -CimSession $cs -Name mycap | |
break | |
# run these next two lines to stop the capture | |
Stop-NetEventSession -CimSession $cs -Name mycap | |
Remove-NetEventSession -CimSession $cs -Name mycap | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment