I have vsphere with a number of distributed virtual switches.
I have a number of port groups on each dvswitch.
I want to get the names and vlan-IDs of all the port groups.
I tried:
Get-VirtualSwitch -Name MyDVSwitch | Get-VirtualPortGroup | Select Name, Vlanid
it returns a list of the port group names and just blank for the VLANID. I was expecting to see:
Name Vlanid
-------- ---------
mypg-1 23
mypg-2 17
mypg-3 48
and so on. But I just get:
Name Vlanid
-------- ---------
mypg-1
mypg-2
mypg-3
any ideas? Also I'd prefer to have a script that doesnt have to specify the dvswitch by name, but rather found all the port groups on all the dvswitches on all the clusters in the data center and listed by name and vlan-id.
thanks