我正在将Windows应用程序事件日志从我的一台服务器导出到XML中进行离线分析。 我能做到这一点…但是当我这样做,我失去了“一般”的描述信息。 这是一个示例事件。 在Windows事件日志查看器中,它显示以下内容作为一般描述:
应用程序“C:\ Program Files(x86)\ Mountain Duck \ Mountain Duck.exe”(pid 2940)无法重新启动 – 应用程序SID与Conductor SID不匹配。
但是,当我输出到XML,这是我得到的:
<Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'> <System> <Provider Name='Microsoft-Windows-RestartManager' Guid='{0888E5EF-9B98-4695-979D-E92CE4247224}'/> <EventID>10010</EventID> <Version>0</Version> <Level>3</Level> <Task>0</Task> <Opcode>0</Opcode> <Keywords>0x8000000000000000</Keywords> <TimeCreated SystemTime='2016-04-07T20:00:10.245609600Z'/> <EventRecordID>6889</EventRecordID> <Correlation/> <Execution ProcessID='3868' ThreadID='4016'/> <Channel>Application</Channel> <Computer>WIN-8S18ONBFAEP</Computer> <Security UserID='S-1-5-21-3589301003-3870519012-1491501718-500'/> </System> <UserData> <RmUnsupportedRestartEvent xmlns='http://www.microsoft.com/2005/08/Windows/Reliability/RestartManager/'> <RmSessionId>0</RmSessionId> <Pid>2940</Pid> <FullPath>C:\Program Files (x86)\Mountain Duck\Mountain Duck.exe</FullPath> <DisplayName>Mountain Duck</DisplayName> <AppVersion>0</AppVersion> <AppType>0</AppType> <TSSessionId>2</TSSessionId> <Status>67108865</Status> <Reason>1</Reason> </RmUnsupportedRestartEvent> </UserData> </Event>
保存事件日志时是否有任何方法来包含描述性文本? 我试过每一个我能想到的search,似乎找不到任何东西。
电源shell
Get-EventLog -LogName System -Newest 100 | select * | Export-Clixml log.xml