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.
doesn't work
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
Check this:
$esxcli = Get-Esxcli -vmhost Hostname -V2
$esxcli.network.nic.list.invoke() | where {$_.linkstatus -eq "up"}
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.