February 20th, 2016

PowerTip: Add network adapter to packet capture session

Doctor Scripto
Scripter

Summary: Learn to use Windows PowerShell to add a network adapter to a capture session.

Hey, Scripting Guy! Question How can I use Windows PowerShell to add a network adapter to a packet capture session?

Hey, Scripting Guy! AnswerUse the Add-NetEventNetworkAdapter cmdlet and specify the name of the adapter. In the following example, I create a network capture session, add a provider, and then add the network adapter:

PS C:\>New-NetEventSession -Name “Session38”

PS C:\> Add-NetEventPacketCaptureProvider -SessionName “Session38”

PS C:\> Add-NetEventNetworkAdapter -Name “Ethernet01”

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.