none
PowerShell - Get VMName, VMNetworkAdapter, SwitchName,IsLegacy, Vlanlist RRS feed

  • Question

  • So far I've figured out that piping these cmdlets will get me everything I need EXCEPT for the "VLANLIST"

    Get-VM | Get-VMNetworkadapter | ft VMname,NAme,SwitchName,isLegacy -Autosize

    I would be totally satisfied if this could also tell me what vlan the network adapter for each vm is operating on.

    This cmdlet does what I want: Get-vmnetworkadaptervlan

    But of course it doesn't give me the switchname, or islegacy values.

    I can't find a way to marry that cmdlet to the one I previously presented.

    What combination works?

    Thanks,

    Jerry

    Tuesday, June 18, 2019 10:31 PM

Answers

  • Hello SilentCow,

    Get-VMNetworkadapter function does not return the VLANlist. You should pipe it to Get-VMNetworkAdapterVlan.

    Something like: Get-VM | Get-VMNetworkadapter | Get-VMNetworkAdapterVlan

    Cheers

    Wednesday, June 19, 2019 10:42 PM

All replies

  • Hello SilentCow,

    Get-VMNetworkadapter function does not return the VLANlist. You should pipe it to Get-VMNetworkAdapterVlan.

    Something like: Get-VM | Get-VMNetworkadapter | Get-VMNetworkAdapterVlan

    Cheers

    Wednesday, June 19, 2019 10:42 PM
  • Hello Silentcow,

    Just wanted to check if you question has been answered? If so please mark the replies as an answer.

    Best regards,

    Malcolm

    Monday, June 24, 2019 9:25 PM