Vba swbem WMI servicelogs查询 - win7x64 [英] Vba swbem WMI servicelogs query - win7x64

查看:121
本文介绍了Vba swbem WMI servicelogs查询 - win7x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查找SWbem WMI查询以生成Win7x64服务日志列表。我正在寻找的日志文件可以使用Win7事件查看器使用以下路径找到...



事件查看器\应用程序和服务日志\ Microsoft \ Windows [...]



我的Win7x64盒子上运行的不同服务列出了大约50个日志文件夹。像WinHTTP,UAC,国际等服务。



我希望能够使用服务日志,备份它们,提取事件,清除它们,等等..



我的尝试:



我是在网上找到了很多标准脚本,大部分是使用Win32_NTEventlogFile类。



不幸的是,Win32_NTEventlogFile类没有生成服务日志列表,只有标准应用程序和安全性等日志。



所以正常的从Win32_NTEventlogFile中选择*对我来说不起作用。



任何人都知道如何通过SWbem和WMI生成和使用ServiceLogs列表?



请指教并谢谢!

Looking for a SWbem WMI query to produce a list of the Win7x64 service logs. The log files which I'm looking for can be found using the Win7 Event Viewer using the following path...

Event Viewer\Applications and Service Logs\Microsoft\Windows\...

There are about 50 log folders listed for different services runinng on my Win7x64 box. Services like WinHTTP, UAC, International, etc.

I'd love to be able to work with the service logs, back them up, extract events, clear them, etc..

What I have tried:

I've found many standard scripts on the web, most of then using the Win32_NTEventlogFile class.

Unfortunately, the Win32_NTEventlogFile class has not produced a list of the service logs, only the standard logs such as the application and security.

So a normal "Select * from Win32_NTEventlogFile" is not working for me.

Anyone know how to produce and work with a list of the ServiceLogs via SWbem and WMI?

Please advise and thanks!

推荐答案

您是否尝试过使用Google搜索?我使用了 WMI查询日志 [ ^ ],似乎有一些解决方案供您尝试。以下是一些看起来很有用的内容:



* wmi查询 - 使用wmi获取最新的Windows日志事件 - Stack Overflow [ ^ ]

* C#WMI读取远程事件日志 - 堆栈溢出 [ ^ ]

* WMI任务:事件日志(Windows) [ ^ ]

* WMI日志文件(Windows) [ ^ ]

* [求助] WMI查询事件日志 - IT编程 - Spiceworks [ ^ ]

* windows - WMI命令行事件log acess - 服务器故障 [ ^ ]

* 查询事件日志 [ ^ ]

* 以及更多...... [ ^ ]





谢谢格雷姆!



你知道,在我发布问题之前我确实看到了一些链接,但他们没有从SWbem的角度处理ServiceLogs。命令行实用程序一直有效(WEvtUtil和Powershell)但我无法使用语法来显示早期绑定的服务事件日志的完整列表

WbemScripting tlb。



Microsoft WMI脚本编写V1.2库

C:\ Windows \ system32 \ wbem \ wbemdisp.TLB



它可能是我正在运行的服务查询...

winmgmts:{impersonationLevel = impersonate,(备份,安全)}!\\\\ \\ cimv2

或对象查询...

select * from Win32_NTEventlogFile



对象查询仅返回标准的Win7类...

应用程序,HardwareEvents,Internet Explorer,密钥管理服务

OAlerts,安全性,系统,Windows PowerShell



我想看看Microsoft-Windows-International / Operational日志文件,以及所有其他服务日志文件。



似乎无法找到正确的根类和/或选择查询。



最好的问候,

Mark
Have you tried using Google Search? I used WMI query logs[^] and there appears to be pages of solutions for you to try. Here are just a handful that look useful:

* wmi query - use wmi to get newest Windows log events - Stack Overflow[^]
* C# WMI reading remote event log - Stack Overflow[^]
* WMI Tasks: Event Logs (Windows)[^]
* WMI Log Files (Windows)[^]
* [SOLVED] WMI Query for event log - IT Programming - Spiceworks[^]
* windows - WMI command line event log acess - Server Fault[^]
* Querying the Event Logs[^]
* and much more...[^]


Thanks Graeme!

You know, I did see some of the links before I posted the question, but they didn't deal with ServiceLogs from a SWbem perspective. The command line utilities have always worked (WEvtUtil and Powershell) but I cannot finc the syntax to display a complete list of the Service Event logs from the early bound
WbemScripting tlb.

Microsoft WMI Scripting V1.2 Library
C:\Windows\system32\wbem\wbemdisp.TLB

It could be the service query I'm running...
winmgmts:{impersonationLevel=impersonate,(Backup, Security)}!\\.\root\cimv2
Or the object query...
select * from Win32_NTEventlogFile

The object query only returns the standard Win7 classes...
Application, HardwareEvents, Internet Explorer, Key Management Service
OAlerts, Security, System, Windows PowerShell

I'd like to see the "Microsoft-Windows-International/Operational" log file, as well as, all of the other service log files.

Can't seem to find the correct root class and/or select query.

Best Regards,
Mark


这篇关于Vba swbem WMI servicelogs查询 - win7x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆