Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem accessing WMI class win32_NetworkAdapterConfiguration

7 views
Skip to first unread message

Paul Steele

unread,
Oct 5, 2005, 2:27:56 PM10/5/05
to
I have some code that uses the WMI class win32_NetworkAdapterConfiguration
to access each adapter in a system. On 99% of the systems the code seems to
work. On a very few the code fails when trying to access the WMI object.
Here's the code:

ManagementClass objMC = new
ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection adapters = objMC.GetInstances();
foreach (ManagementObject adapter in adapters)
...
The call to objMC.GetInstances fails. The error message (via a try/catch) is
simple "Not found" which is basically useless. The computer in question is a
student notebook with all sorts of extras installed, but I don't see
anything obvious that would interfere with WMI. The WMI service is also
running. Google searches have so far come up dry, but I don't have a very
useful item to key my search on. Has anyone got any suggestions on what
might be causing this problem?


Willy Denoyette [MVP]

unread,
Oct 5, 2005, 2:37:09 PM10/5/05
to

"Paul Steele" <paul....@acadiau.ca> wrote in message
news:%23X6BDqd...@TK2MSFTNGP15.phx.gbl...

What OS are these failing systems running? Did you try to create an instance
of this class using Wbemtest.exe or a simple Vbscript?

Willy.


Paul Steele

unread,
Oct 5, 2005, 3:07:59 PM10/5/05
to

The student in question was very keen and tracked the problem down himself.
Turned out
that his WMI database was corrupted and he found this link to fix it:

http://windowsxp.mvps.org/repairwmi.htm

0 new messages