PowerShell Genie

Find disconnected adapters

Script 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Use Get-NetAdapter to list interfaces whose status is not Up. Include the interface name, status, and driver description for investigation.

The script

1PS> Get-NetAdapter | Where-Object Status -ne Up | Select-Object Name,Status,InterfaceDescription

Script reader

Inspect before you run

Inspection only

Inspect the script below. It does not run in this browser.

Inspection only — no command has run.

    Show reference output
    1 Name Status InterfaceDescription
    2 ---- ------ --------------------
    3 Ethernet 2 Disconnected Intel(R) Ethernet Adapter
    Inspect this example’s structure

    Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

    Get-NetAdapter | Where-Object Status -ne Up | Select-Object Name,Status,InterfaceDescription
    1. Stage 1Get-NetAdapterPositional values or no named parameters
    2. Stage 2Where-Object-ne
    3. Stage 3Select-ObjectPositional values or no named parameters

      How it works

      Get-NetAdapter is filtered to interfaces whose Status is anything other than Up, and the projection keeps the friendly name with that status and the driver description so the physical port can be identified in the rack.

      Adapting it

      Narrow this to genuine link failures with Where-Object Status -eq 'Disconnected', since the unfiltered version also returns adapters that are administratively disabled and were meant to stay that way.

      If the result is unexpected

      A disconnected adapter is mistaken for a broken physical network port.

      Disabled, virtual and unused adapters can be expected to show disconnected state.

      1. Inspect adapter description, status and intended role before treating it as an incident.

      Validate the result

      The affected physical or virtual interface is identified and its expected state is documented.

      Keep the check reliable

      Maintain an inventory of intentionally unused adapters to reduce misleading alerts.

      Primary documentation

      PowerShell objects and pipelines documentation

      Continue
      Genie guideFind disconnected adapters

      Use Get-NetAdapter to list interfaces whose status is not Up. Include the interface name, status, and driver description for investigation.