Skip to content

NetworkInterface.GetAllNetworkInterfaces() doesn't list disabled adapters on Windows #89990

@skyoxZ

Description

@skyoxZ

Description

On Windows, a disabled network adapter is not listed by NetworkInterface.GetAllNetworkInterfaces().

Reproduction Steps

  1. foreach (var ni in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
    {
        Console.WriteLine(ni.Name + ": " + ni.OperationalStatus);
    }
  2. Disable a network adapter.
  3. Run the code again.

Expected behavior

The disabled adapter is listed with OperationalStatus.Down.

Actual behavior

The disabled adapter is not listed.

Regression?

No response

Known Workarounds

No response

Configuration

Windows 10
.NET 6 / .NET 7

Other information

No response

Metadata

Metadata

Assignees

Labels

area-System.Nethelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedos-windows

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions