大网数据广告活动
启动与系统组件

Win32_NetworkAdapterConfiguration class is unable to retrieve information

· 52CE 我爱测

This article provides a resolution for the problem where the Win32_NetworkAdapterConfiguration class is unable to retrieve information about PPPoE (Point-to-point protocol over Ethernet) and VPN (Virtual Private Network).

This article helps you resolve the problem where the Win32_NetworkAdapterConfiguration class is unable to retrieve information about PPPoE (Point-to-point protocol over Ethernet) and VPN (Virtual Private Network).

Applies to:   Windows Vista
Original KB number:   2549091

Symptoms

On Windows Vista and later, the Win32_NetworkAdapterConfiguration class is unable to retrieve information about a PPPoE connection and VPN connection.

If a program is designed to get the information about the dial-up connection or a virtual private network by using the Win32_NetworkAdapterConfiguration class on Windows XP, it may not work on Windows Vista and later.

For more information about the Win32_NetworkAdapterConfiguration class, see Win32_NetworkAdapterConfiguration class.

Cause

On Windows Vista and later, the Win32_NetworkAdapterConfiguration class does not create an instance for a PPPoE connection or VPN connection. Microsoft has confirmed that this to be a problem in our product.

Resolution

On Windows Vista and later, you can retrieve almost the same information as the Win32_NetworkAdapterConfigurationthe class does regarding a PPPoE connection or VPN connection by using either of the following methods. It would be highly appreciated if you consider that either of the following method is acceptable.

  1. Use the .NET Framework NetworkInterface class.

    Use the NetworkInterface.GetAllNetworkInterfaces method to get a NetworkInterface array. Then, go through the NetworkInterface array to find a NetworkInterface instance that has the NetworkInterface.NetworkInterfaceType property set as Ppp. Each value of a PPPoE or VPN connection can be retrieved by referencing each property that this instance has.

    For more information on the NetworkInterface class or the sample code for this, see NetworkInterface Class.

    For more information on each property of the NetworkInterface class, see NetworkInterface Class.

  2. Use the GetAdaptersAddresses API.

    Use the GetAdaptersAddresses API to get the IP_ADAPTER_ADDRESSES structure. Then, go through the linked list of IP_ADAPTER_ADDRESSES structures to find an element that has the IfType member set as IF_TYPE_PPP. Each value of a PPPoE or VPN connection can be retrieved by referencing each member of the element.

    For more information on the GetAdaptersAddresses API or the sample code for this, see GetAdaptersAddresses function (iphlpapi.h).

    For more information on each member of the IP_ADAPTER_ADDRESSES structure, see IP_ADAPTER_ADDRESSES_LH structure (iptypes.h).

Steps to reproduce

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 06/11/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。