Get HyperV Team name the given virtual Switch (name provided) is connected ?

Hi Guys
Using Powershell, How to get Hyper-V Team name the given virtual switch is connected to?
Thank you
LVL 19
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ITguy565Commented:
I believe the command you are looking for is
Get-NetLbfoTeam

Open in new window


PS C:\> Get-NetLbfoTeam
Name                   : VMTestTeam
Members                : {Ethernet 4, Ethernet}
TeamNics               : VMTestTeam
TeamingMode            : SwitchIndependent
LoadBalancingAlgorithm : TransportPorts
Status                 : Degraded


This document should give you a good understanding of NIC teaming with powershell :
http://techgenix.com/windows-nic-teaming-using-powershell-part/
http://techgenix.com/windows-nic-teaming-using-powershell-part6/
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperAuthor Commented:
looking for complete command please if possible
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperAuthor Commented:
This worked. Found myself.
Thanks for expert's inputs.

$vSwitchName = "XYZ"
Try
{
    
    $vmnetswitch = Get-VMSwitch -Name $vSwitchName
    $vmnetwork = Get-NetAdapter -InterfaceDescription $($vmnetswitch.NetAdapterInterfaceDescription)
    if($vmnetwork)
    {
            write-host "vSwitch $($vSwitchName) is connected to $($vmnetwork.Name) Network team"
    }
else
{
    write-host "vSwitch $($vSwitchName) is NOT Found connected to any Network team"
}
}
catch
{
       Write-host "Error Getting vSwitch Info"
}

Open in new window

Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperAuthor Commented:
$vSwitchName = "XYZ"
Try
{
    
    $vmnetswitch = Get-VMSwitch -Name $vSwitchName
    $vmnetwork = Get-NetAdapter -InterfaceDescription $($vmnetswitch.NetAdapterInterfaceDescription)
    if($vmnetwork)
    {
            write-host "vSwitch $($vSwitchName) is connected to $($vmnetwork.Name) Network team"
    }
else
{
    write-host "vSwitch $($vSwitchName) is NOT Found connected to any Network team"
}
}
catch
{
       Write-host "Error Getting vSwitch Info"
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.