How to check network interface card that are disconnected?
How to check which network adapter is disconnected or not functioning?
How to check which network adapter is disconnected or not functioning?
This would be useful to check if the network cable has been
unplugged accidentally.
This code snippet below will help to troubleshoot network connectivity issues. If the network cable is faulty or other network issues that causes the media to be disconnected.
This code snippet below will help to troubleshoot network connectivity issues. If the network cable is faulty or other network issues that causes the media to be disconnected.
Or network interface card that has been disconnected due to
a router or switch issue.
The script below will show any NICs that has the status of
disconnection and will display the NIC interface name that is disconnected.
If the server has multiple interfaces script will count all
the interfaces that are disconnected.
If need to check for
disabled devices change the value to 5, for devices that has malfunction set
the value to 6.
To dig further more check out this link from MSDN:
Hardware Disabled (5)
Hardware Malfunction (6)
Media Disconnected (7)
PowerShell script to check disconnected network interfaces:
$nic_discon = Get-WmiObject -class Win32_NetworkAdapter
-Filter "NetConnectionStatus
= '7'"
Write-Host "Number of disconnected NICs: " $nic_discon.Count
foreach ($nic_name
in $nic_discon)
{
$nic_name.Name
}
======================================
Cheers.. Enjoy..
Comments
Post a Comment