2

Somebody Else's Code says:

var wmiNetAdapterConfiguration = new ManagementClass("Win32_NetworkAdapterConfiguration");
var wmiNetAdapters = wmiNetAdapterConfiguration.GetInstances();
var count = wmiNetAdapters.Count; // throws exception

This bombs in my dev environment with System.Management.ManagementException: "Provider failure".

The original author is not available for questioning, and I have no idea what this means, or why it is failing in my environment. Help please!

Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
  • 2
    Check out the following SO question: http://stackoverflow.com/questions/563150/how-can-i-resolve-a-provider-load-failure-for-wmi-requests – Christophe Geers Sep 20 '11 at 12:13

1 Answers1

0

This error also occur if you're connecting to a remote machine, authenticating using a local account (local to the remote machine!), and UAC is enabled. Setting per-namespace permissions might help, depends on the WMI namespace I suspect. Disabling UAC should resolve it.

Chalky
  • 1,624
  • 18
  • 20