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
  • Looking for Feedback
  • Attach files
  • Guest commented
    December 01, 2021 22:12

    doesn't work

  • Guest commented
    July 22, 2020 18:58

    Thank you. Below scripts works what i exactly required

    $esxcli = Get-Esxcli -vmhost Hostname -V2

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

    Can you help to update how we can get for all the ESXi hosts in the vCenter server

    hostname, cluster, vmnic, link status, duplex admin status, driver, firmware.macaddress,mtu

    .etc

  • Guest commented
    September 25, 2018 08:33

    Check this:

    $esxcli = Get-Esxcli -vmhost Hostname -V2

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

  • Guest 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.