{"id":77221,"date":"2016-02-21T11:59:02","date_gmt":"2016-02-21T19:59:02","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=77221"},"modified":"2019-02-18T09:19:48","modified_gmt":"2019-02-18T16:19:48","slug":"powertip-add-hyper-v-network-switch-to-network-packet-capture-session","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-add-hyper-v-network-switch-to-network-packet-capture-session\/","title":{"rendered":"PowerTip: Add Hyper-V network switch to network packet capture session"},"content":{"rendered":"<p><strong>Summary<\/strong>: Learn how to add a Hyper-V virtual switch as a filter for a remote packet capture session.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>\u00a0How can I use Windows PowerShell to add a Hyper-V Virtual switch as a provider for a remote packet capture session?<\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>\u00a0Use the <strong>Add-NetEventVmSwitch<\/strong> 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:<\/p>\n<p style=\"padding-left: 90px\">PS C:\\&gt;New-NetEventSession -Name &#8220;NESession01&#8221;<\/p>\n<p style=\"padding-left: 90px\">PS C:\\&gt; Add-NetEventPacketCaptureProvider -SessionName &#8220;NESession01&#8221;<\/p>\n<p style=\"padding-left: 90px\">PS C:\\&gt; Add-NetEventVMSwitch -Name &#8220;Network Adapter 2 &#8211; Virtual Switch&#8221;<\/p>\n<p style=\"padding-left: 30px\">\u00a0<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\" \" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to add a Hyper-V virtual switch as a filter for a remote packet capture session. \u00a0How can I use Windows PowerShell to add a Hyper-V Virtual switch as a provider for a remote packet capture session? \u00a0Use the Add-NetEventVmSwitch cmdlet and specify the name of the switch. In the following commands, I [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[639],"tags":[356,3,45],"class_list":["post-77221","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powertip","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to add a Hyper-V virtual switch as a filter for a remote packet capture session. \u00a0How can I use Windows PowerShell to add a Hyper-V Virtual switch as a provider for a remote packet capture session? \u00a0Use the Add-NetEventVmSwitch cmdlet and specify the name of the switch. In the following commands, I [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/77221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=77221"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/77221\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=77221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=77221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=77221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}