VMware Cloud Community
alxta13
Contributor
Contributor

cluster network names

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

BR,
Alex

0 Kudos
3 Replies
LucD
Leadership
Leadership

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

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
alxta13
Contributor
Contributor

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)

0 Kudos
alxta13
Contributor
Contributor

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

0 Kudos