如何收集新的“应用程序和服务日志”在 Windows 7 或 Windows Server 2008 上使用 WMI 找到了吗?
在 Windows Server 2008 和 Windows 7 中,“应用程序和服务日志”下有分类的新事件。还有一个名为 Microsoft 的子文件夹,其中也包含大量子文件夹。
有没有办法通过WMI收集这些事件?对于常规“Windows 日志”(例如应用程序和安全性),可以使用 cimv2 命名空间中的 Win32_NTLogEvent WMI 类。但是,此类不提供对新 Microsoft 事件日志的访问。
有什么想法吗?
In Windows Server 2008 and Windows 7 there are new Events categorized under "Applications and Services Logs". There is also a subfolder called Microsoft which has tons of subfolders as well.
Is there any way to collect these events through WMI? For the regular "Windows Logs" such as Application and Security, it is possible to use the Win32_NTLogEvent WMI class in the cimv2 namespace. However, this class does not provide access to the new Microsoft event logs.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这是一个老问题,但对于任何遇到这个问题的人来说,实际上可能是这样,您只需将注册表项添加到您要查询的日志的以下位置即可。在我的情况下,Microsoft-Windows-PrintService/Admin 或 Microsoft-Windows-TaskScheduler/Operational(两个部分均带有斜杠)到以下位置。
不是很好,但至少是这样。
感谢 McAfee(下面是 Google 上的一些结果,但希望可以阻止一些人过早放弃!)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\
https://kc.mcafee.com/corporate/index?page=content&id=KB81367
也链接自community.mcafee.com/thread /64301
屏幕截图
I know this is an old question, but to anyone stumbling across this, it IS actually possibly, you just need to add a registry key to the below location for the log you want to query ie. Microsoft-Windows-PrintService/Admin, or Microsoft-Windows-TaskScheduler/Operational in my case (both parts, with the slash) to the below location.
Not great, but at least it's something.
Credit to McAffee (a few results below on Google, but hopefully may stop some people giving up prematurely!)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\
https://kc.mcafee.com/corporate/index?page=content&id=KB81367
also linked from community.mcafee.com/thread/64301
screenshot
由于缺乏 WMI 答案,这可能是不可能的;也许您可以考虑使用 PowerShell 或调用命令行 wevtutil实用程序?
Based on the dearth of WMI answers, it may not be possible; perhaps you could consider using PowerShell or calling the command-line wevtutil utility?