February 21st, 2016

PowerTip: Add Hyper-V network switch to network packet capture session

Doctor Scripto
Scripter

Summary: Learn how to add a Hyper-V virtual switch as a filter for a remote packet capture session.

Hey, Scripting Guy! Question How can I use Windows PowerShell to add a Hyper-V Virtual switch as a provider for a remote packet capture session?

Hey, Scripting Guy! Answer Use the Add-NetEventVmSwitch cmdlet and specify the name of the switch. In the following commands, I create a new event session, specify a packet capture provider, and then add the Hyper-V switch:

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

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

PS C:\> Add-NetEventVMSwitch -Name “Network Adapter 2 – Virtual Switch”

 

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.