vSwitch in Promiscuous Mode

Paul Green 21 Reputation points


I have a Server 2019 Hyper-V Host and need to setup one of the vSwitches for port mirroring in Promiscuous Mode (as I understand it, at least). I have done this in the past using the below PS but am getting an error on this Host (previous hosts were running 2012R2).

Here is what I am typing into PS:

PS C:\Windows\system32> $a = Get-VMSystemSwitchExtensionPortFeature -FeatureId 776e0ba7-94a1-41c8-8f28-951f524251b5

PS C:\Windows\system32> $a.SettingData.MonitorMode = 2

PS C:\Windows\system32> Add-VMSwitchExtensionPortFeature -ExternalPort –SwitchName NAMEOFMYSWITCH -VMSwitchExtensionFeature $a

I get the below error:

Add-VMSwitchExtensionPortFeature : Failed while modifying virtual Ethernet switch connection settings.

At line:1 char:1

+ Add-VMSwitchExtensionPortFeature -ExternalPort –SwitchName NAMEOFMYSWITCH ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (:) [Add-VMSwitchExtensionPortFeature], VirtualizationException

+ FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.AddVMSwitchExtensionPortFeature

Not sure what to make of that and I can't find much information when I search.

Any suggestions appreciated.

Many thanks

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,501 questions
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,568 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,403 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Eric Siron 1,251 Reputation points MVP

    I get this error when I run your PS against a virtual switch that already has the security settings extension installed. Try your PS with Set-VMSwitchExtensionPortFeature instead of Add-...

    If that still doesn't work, first run

    Get-VMSwitchExtensionPortFeature -ExternalPort

    If that shows the security settings feature and nothing else, then you can:

    Get-VMSwitchExtensionPortFeature -ExternalPort | Remove-VMSwitchExtensionPortFeature

    If you have more than one feature installed, then you'll have to add filters to the Get-VMSwitchExtensionPortFeature until you narrow it down to the one that you want.

    After you have successfully removed the feature, you should have no trouble with your original PS that uses the Add-...

    2 people found this answer helpful.

  2. Mark Clift 1 Reputation point

    I am having the same problem. Did you ever find and answer?

    0 comments No comments

  3. Paul Green 21 Reputation points


    I never found an answer. In the end I installed Server 2012R2 on the host as a work-around.

    0 comments No comments

  4. Mark Clift 1 Reputation point

    @Eric Siron Thank you for your reply.

    Using your suggestions I was able to work around the error.

    0 comments No comments