簡體   English   中英

如何以編程方式確定事件ID的描述

[英]How can I programmatically determine the description of an Event ID

我編寫了一個實用程序,使我可以查看EventLog消息,過濾它們的類型,編寫時間等。

我發現自購買筆記本電腦以來的最近幾個月中,我已經輸入了數以千計的記錄(給予或接受幾次):

Type: Error
Source: WinMgmt
Time Generated: 06/11/2012 20:55:00
Message: The description for Event ID '-1073741814' in Source 'WinMgmt' cannot be found.  The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them.  The following information is part of the event:'//./root/CIMV2', 'SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA "Win32_Processor" AND TargetInstance.LoadPercentage > 99', '0x80041003'
Machine Name: MuleheadedAsteroid

有人知道我可能會如何響應這樣的錯誤消息以便深入了解問題嗎?

您在這里問兩個問題。 首先,為什么事件日志條目的格式不正確? (您看到的是消息的參數,而不是完整格式的消息。首先,我們將修復消息。

似乎是注冊表損壞或消息文件dll丟失。

檢查以確保這些注冊表項存在,並指向正確的位置:

1)HKEY_LOCAL_MACHINE \\ SYSTEM \\ CurrentControlSet \\ services \\ eventlog \\ Application \\ WinMgmt

Name:  ProviderGuid
Type:  REG_EXPAND_SZ
Value: {1edeee53-0afe-4609-b846-d8c0b2075b1f}

2)HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ Windows \\ CurrentVersion \\ WINEVT \\ Publishers \\ {1edeee53-0afe-4609-b846-d8c0b2075b1f}

存在的值:

Name:  MessageFileName
Type:  REG_EXPAND_SZ
Value: %SystemRoot%\system32\wbem\WinMgmtR.dll

Name:  ResourceFileName
Type:  REG_EXPAND_SZ
Value: %SystemRoot%\system32\wbem\WinMgmtR.dll

3)最后,在%SystemRoot%\\ system32 \\ wbem \\ WinMgmtR.dll中驗證WinMgmtR.dll的存在


其次,什么是事件日志試圖告訴我們。 我用Google搜索了錯誤代碼0x80041003。 這立即使我進入了有關嘗試使用權限不足來查詢WMI的討論,尤其是有關知識庫的文章:

安裝Windows Vista Service Pack 1或Windows Server 2008后,在應用程序日志中記錄事件ID 10

您會注意到,MS的示例查詢與您的示例查詢幾乎完全相同。因此,似乎正在運行某些東西,並且在沒有足夠權限的情況下查詢WMI。

MS提供了一個腳本來阻止條目顯示在KB文章的分辨率部分中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM