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
    1 Dec, 2021 10:12pm

    doesn't work

  • Guest commented
    22 Jul, 2020 06:58pm

    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
    25 Sep, 2018 08:33am

    Check this:

    $esxcli = Get-Esxcli -vmhost Hostname -V2

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

  • Guest commented
    18 May, 2018 10:54pm

    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.