如何解决“提供商加载失败”问题 用于 WMI 请求?
我正在使用 WMI 来收集系统信息。 它在我测试过的每个系统上都运行良好,但我有一两个用户报告了问题。 调试日志显示 WMI 代码抛出“提供程序加载失败”异常。 我无法复制这个问题。
用户已验证 WMI 服务正在自动模式下运行。
这是例外情况:
System.Management.ManagementException: Provider load failure
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
对于如何排查和解决此问题有什么想法吗?
I'm using WMI to collect system information. It works fine on every system I've tested it on, but I have one or two users that are reporting problems. The debug logs show the WMI code is throwing a "Provider load failure" exception. I haven't been able to replicate the issue.
The users have verified that the WMI service is running in Automatic mode.
Here's the exception:
System.Management.ManagementException: Provider load failure
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
Any thoughts on how to troubleshoot and resolve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
可能追踪问题根本原因的一种方法是使用 WBEMTest MS 脚本专家认为该工具是最简单的方法之一
脚本专家:使用 PowerShell 解决“提供程序加载失败”
此 Win32_network 适配器“提供程序加载失败” 由 Mark Wolzak 在 infoSupport 发布。
感谢WMI – 提供程序加载失败 在 Richard Siddaway 的博客上发帖,向我指出了这个工具和具体方法。
One way to possibly track down the root cause of the issue is to use WBEMTest a tool that the MS Scripting Guys say is one of the easiest ways
The Scripting Guys: Use PowerShell to Troubleshoot “Provider Load Failure”
The high level steps specific to the Win32_NetworkAdapter are described in this Win32_network adapter "provider load failure" post by Mark Wolzak at infoSupport.
Thanks to the WMI–Provider Load Failure post at Richard Siddaway's Blog for pointing me to this tool and specific methodology.
在具有用户帐户控制的操作系统上关闭 UAC。
就我而言:罗斯的回答没有解决。 我可以加载一些 WMI 提供程序(逻辑磁盘),但不能加载其他提供程序(IIS)。 WMI 浏览器工具(例如 PowerGui)将显示提供程序。 这表明安全策略可以阻止加载 WMI 提供程序。 关闭 UAC 后,所有 WMI 提供程序都会正确加载。
当然,您可能希望将 UAC 保持打开状态。 如果我找到所需的具体政策,我会更新此答案。
On operating systems with User Account Control turn off UAC.
In my case: Ross's answer about did not resolve. I could load some WMI providers (logicaldisk) but not others (IIS). WMI explorer tools (such as PowerGui) would show the provider. This suggested that security policy can prevent loading WMI providers. Once UAC was turned off all WMI providers loaded without error.
Of course, you might want to leave UAC on. I'll update this answer if I find the specific policies required.
所以,我知道这已经很旧了,但我遇到了上面描述的确切问题。 这对我来说真的很难弄清楚,所以我想我会做出回应,希望它能帮助其他人。
我尝试加载 IIS WMI 提供程序并收到“提供程序加载失败”错误。 我可以通过使用 wbemtest.exe 程序运行 WMI 查询来重现该问题。
我启动了 procmon.exe 以显示正在加载的内容(或者在我的情况下无法加载),果然,wmiprvse.exe 加载注册表项时说 inetsrv 位于 C:\windows 目录中 - 但它并没有存在于我的机器上(C:\windows 已被 c:\winnt 取代)
更新密钥解决了我的问题,但更重要的是,我花了很长时间试图找出为什么会出现此错误,并在执行 WMI 查询时运行 procmon 指出了问题所在。 希望它也适合你。
So, I know this is old, but I was having the exact problem described above. It was really tough for me to figure out, so I thought I would respond in hopes it helps someone else out.
I was attempting to load the IIS WMI Provider and getting the "Provider Load Failure" error. I could reproduce the problem by running my WMI query using the wbemtest.exe program.
I fired up procmon.exe to show what was being loaded (or failing to load in my case) and sure enough, wmiprvse.exe was loading a registry key was saying that inetsrv was located in the C:\windows directory - which did not exist on my machine (C:\windows had been replaced by c:\winnt)
Updating the key resolved my issue, but the bigger point here is that I had one hell of a time trying to figure out why I was getting this error, and running procmon while executing my WMI query pointed me right to the problem. Hopefully it will for you too.
您可能需要确认所有 dll 均已正确注册(请参阅 http://msdn .microsoft.com/en-us/library/bb961987.aspx)。
You might want to confirm all the dlls are properly registered (see http://msdn.microsoft.com/en-us/library/bb961987.aspx).
WMI 注册全部保存在 WMI(静态类)中。WMI
CIM Studio(MS、IIRC 的 WMI 工具的一部分)对于探索这些类很有用(并且肯定比编写大量查询更容易)。
WMI registration is all held in WMI (static classes.
WMI CIM Studio (part of WMI Tools from MS, IIRC) is useful for exploring these classes (and certainly easier than writing lots of queries).