使用PowerShell(版本2+)获取Windows日志

时间:2014-10-29 09:30:34

标签: powershell powershell-v2.0 powershell-v3.0 powershell-ise

我想通过PowerShell获取所有类型的Windows日志,如下所示 -

Application, 
Security, 
System, 
Setup, 
Forwarded Events

我可以通过Application and System命令获取Get-EventLog日志,但我无法通过它Security, Setup, Forwarded Events

我尝试使用Get-WinEvent -LogName。它适用于Setup and Security,但不适用于Forwarded events。我得到的错误是 -

Get-WinEvent : No events were found that match the specified selection criteria.

问题#1。是否由于转发事件中没有日志条目?如果是,我如何在转发事件中创建条目&验证是否是这种情况。

此外,Get-EventLog命令的响应包括以下head-

Index
Time
EntryType
Source
InstanceID
Message

但是,Get-WinEvent -LogName命令的响应不包括它们。它只包括 -

TimeCreated
Id
LevelDisplayName
Message

问题#2。我有什么办法可以像Get-EventLog命令一样做出响应吗?

请帮助。

由于

0 个答案:

没有答案
相关问题