Hey all,
What is the best way to list all the networks names i have under cluster?
BR,
Alex
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
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)
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