Hyper-V host virtual net adapter

This topic contains 1 reply, has 1 voice, and was last updated by  Albert Chern 3 months, 4 weeks ago.

  • Author
    Posts
  • #77664

    Albert Chern
    Participant

    How do you get a handle to the virtual network adapter on the host that is connected to a given internal VM switch? The only way I can figure out is to look for one named "vEthernet ($switchName)", but it's not very robust, as Hyper-V allows you to create switches with duplicate names, and I'm not sure if this naming scheme is consistent across versions. Hyper-V must keep a record of this somewhere as it will automatically remove the correct virtual net adapter when the VM switch is removed, but I wasn't able to find it after a fair bit of digging.

  • #77682

    Albert Chern
    Participant

    The answer is to look for it in VM network adapters instead of the host's network adapter list:

    Get-VMNetworkAdapter -ManagementOS | where SwitchName -eq $switchName
    

You must be logged in to reply to this topic.