Vista 中的 WMI 中是否缺少 Win32_PerfFormattedData_PerfDisk_PhysicalDisk?

发布于 2024-08-26 21:33:09 字数 1386 浏览 4 评论 0原文

据我了解,以下脚本的输出在 Windows XP 及更高版本中应包含“Win32_PerfRawData_PerfDisk_PhysicalDisk”,但在 Vista Business 32 位 Service Pack 2 中不适合我。到目前为止,我在谷歌上搜索有关以下内容的信息非常不成功本次表演课。

strComputer = "."
Set objWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
strComputer & "\root\cimv2")

For Each objclass in objWMIService.SubclassesOf()
    Wscript.Echo objClass.Path_.Class
Next

Vista 中是否根本不存在此 WMI 类?如果只有我一个人,有办法修复WMI吗?我已经尝试运行 winmgmt /resetrepository 和 winmgmt /resyncperf 但都没有帮助。

编辑:排序和编辑的输出

剪切...

  • Win32_PerfFormattedData_NETFramework_NETCLRSecurity
  • Win32_PerfFormattedData_Outlook_Outlook
  • Win32_PerfFormattedData_PerfNet_Browser
  • Win32_PerfFormattedData_PerfNet_Redirector

剪切...

Win32_PerfFormattedData_PerfDisk_* 丢失。

还尝试了 lodctr /R。没有帮助。

已解决

这些计数器可以在注册表中禁用。只需将 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Perfdisk\Performance\Disable Performance Counters 设置为 0 并重新启动即可。

http://blogs.technet.com/askperf/archive/2010/03/05/two-million-drill-disabled-performance-counters-and-exctrlst-exe.aspx

From what I understand, the output from the following script should include "Win32_PerfRawData_PerfDisk_PhysicalDisk" in Windows XP and higher, but it doesn't for me in Vista Business 32-bit Service Pack 2. Thus far I have been very unsuccessful googling for information about this performance class.

strComputer = "."
Set objWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
strComputer & "\root\cimv2")

For Each objclass in objWMIService.SubclassesOf()
    Wscript.Echo objClass.Path_.Class
Next

Does this WMI class simply not exist in Vista? If it is just me, is there a way to fix WMI? I have already tried running winmgmt /resetrepository and winmgmt /resyncperf and neither helps.

Edit: Sorted and Edited Output

snip...

  • Win32_PerfFormattedData_NETFramework_NETCLRSecurity
  • Win32_PerfFormattedData_Outlook_Outlook
  • Win32_PerfFormattedData_PerfNet_Browser
  • Win32_PerfFormattedData_PerfNet_Redirector

snip...

Win32_PerfFormattedData_PerfDisk_* is missing.

Also tried lodctr /R. No help.

SOLVED

These counters can be disabled in the registry. Just set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Perfdisk\Performance\Disable Performance Counters to 0 and reboot.

http://blogs.technet.com/askperf/archive/2010/03/05/two-minute-drill-disabled-performance-counters-and-exctrlst-exe.aspx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋风の叶未落 2024-09-02 21:33:09

Vista 应该没问题。文档此处在底部声明页面:

DLL:Windows Server 2003 和 Windows XP 上的 Wmicookr.dll,Windows Server 2008 和 Windows Vista 上的 WmiPerfInst.dll。

您能否检查一下您的机器上是否存在 WmiPerfInst.dll DLL?

另一件要尝试的事情是看看是否可以从相应的 RawData 类中获取统计信息? Vista 似乎改变了原始数据转换为熟数据的方式。我对此的了解非常薄弱(基于非常粗略的 Google 搜索),因为我只涉及 XP/Svr2k3/Svr2k8 上的 WMI - 我认为没有人实际上使用 Vista :- )


而且,如果您要接受我的答案,即使它没有帮助,至少让我抄袭您的解决方案:-)

可以在注册表中禁用这些计数器。只需将 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Perfdisk\Performance\Disable Performance Counters 设置为 0 并重新启动即可。

但说实话,谢谢你。在某些时候,我们可能必须自己支持后 Vista,因此这将帮助我们了解这一点。

Should be okay on Vista. the docs here state at the bottom of the page:

DLL: Wmicookr.dll on Windows Server 2003 and Windows XP, WmiPerfInst.dll on Windows Server 2008 and Windows Vista.

Can you check that the WmiPerfInst.dll DLL exists on your box?

Another things to try is to see if you can get stats from the corresponding RawData class? Vista appears to have changed the way in which raw data is translated to cooked data. My knowledge of that is pretty thin (based on a very cursory Google search) since I'm only involved in WMI on XP/Svr2k3/Svr2k8 - I didn't think anyone was actually using Vista :-)


And, if you're going to accept my answer even though it didn't help, at least let me plagiarise your solution :-)

These counters can be disabled in the registry. Just set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Perfdisk\Performance\Disable Performance Counters to 0 and reboot.

But seriously, thanks for that. At some point, we'll probably have to support post-Vista ourselves so it'll help us out to know this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文