VMware PowerCLI

The Best User Interface for your VMware Datacenter!

Get-VMHostNetworkAdapter Link "up/down" status property

Currently there is no property for physical network adapters on hosts that simply lists the link as "up" or "down" like you would be able to see from the ESXCLI or in the vSphere client. This would be useful for getting a quick report of all hosts that have links that are up/down if you are having physical networking issues, or potentially NIC driver/firmware issues. Currently the best option I have is to run

'''Get-VMHostNetworkAdapter -Host $vmhost -Physical | Where-Object { $_.BitRatePerSec -eq "0" }'''

which is fine but I'd rather have a discreet "up/down" property value rather than using the detected link speed, or possibly the duplex value. It's also rather simple to do from the ESXCLI and would be nice to be able to do across all hosts in a vCenter.

  • Marcus Puckett
  • Feb 12 2018
  • Attach files
  • Kevin Lengel commented
    May 18, 2018 22:54

    100% agree here.  The web client seems to be able to pull pnic info in with assigned vswitch info.  The most useful part is knowing the connectivity status of pnics ONLY attached to vSwitches (Standard and distributed).  Many times there are pnics on a system (1Gb) that are not used and no one cares about.

  • Heiko Kempf commented
    September 25, 2018 08:33

    Check this:

    $esxcli = Get-Esxcli -vmhost Hostname -V2

    $esxcli.network.nic.list.invoke() | where {$_.linkstatus -eq "up"}