Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 229602

Re: VirtualSwitch and Virutalport group details

$
0
0

I combined the virtualportgroup name and the VLanId, you'll get something like "pg1-123", where pg1 is the portgroupname and 123 is the VLanId.

 

foreach($clusterinGet-Cluster){
   
foreach($esxinGet-VMHost-Location$cluster){
       
Get-VirtualSwitch-VMHost$esx|
       
Select@{N="Cluster";E={$cluster.Name}},
           
@{N="ESXi";E={$esx.Name}},
           
@{N="vSwitch";E={$_.Name}},
           
@{N="Portgroups";E={[string]::Join(',',(Get-VirtualPortGroup-VirtualSwitch$_|%{"$($_.Name)-$($_.VLanId)"}))}}
    }
}

Viewing all articles
Browse latest Browse all 229602

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>