How to check the Hyper-v vm associated with which switch using powershell command

Isaac Anish Martin Viju 61 Reputation points
2020-08-13T07:07:05.437+00:00

We have 400 hyper-v host manged by SCVMM, Each hyper-v host have three external virtual S/W,Here i need to check which vm connected with which external virtual S/W using powershell.
Could any help me..?

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,664 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Laude 85,766 Reputation points
    2020-08-13T07:43:55.53+00:00

    Hi,

    You can use the following PowerShell script:

    $VMs = Get-VM  
    Get-VMNetworkAdapter -VMName $VMs.Name | Select-Object VMName, SwitchName  
    

    Example result:
    17359-example.png

    ----------

    (If the reply was helpful please don't forget to accept as answer, thank you)

    Best regards,
    Leon

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.