PowerCLI

 View Only
  • 1.  cluster network names

    Posted Dec 03, 2020 09:20 AM

    Hey all,
    What is the best way to list all the networks names i have under cluster?

    BR,
    Alex



  • 2.  RE: cluster network names

    Posted Dec 03, 2020 09:40 AM

    There are many ways of doing that, this is one example.

    Get-VirtualPortGroup -VMHost (Get-Cluster -Name MyCluster | Get-VMHost)


  • 3.  RE: cluster network names

    Posted Dec 03, 2020 09:52 AM

    tnx but somehow the output is listing more then it is visible on VC

    i have 23 but output gives 44 (some are duplicate and some are named with name i dont have like VMotion1o or Management Network)



  • 4.  RE: cluster network names

    Posted Dec 03, 2020 09:56 AM

    i found this on web and this is listing exactly 23 names as i see them in VC ‌‌

    $networks = (Get-Cluster MyCluster).ExtensionData.Network

    foreach ($network in $networks) {

        Get-View $network -Property Name | select Name

    }

    this works as well 

    $cluster = Get-View -ViewType ClusterComputeResource -Filter @{ name = 'MyCluster' }

    $cluster.UpdateViewData('network.name')

    $cluster.LinkedView.Network.Name