简体   繁体   中英

Unique identifier for an event in Event Log

I have a Windows Event Log file (.evt/.evtx) and I want to select a particular event from the Event Log using power shell. I see cmdlets like

$provider = Get-WinEvent -listprovider $EventSource
$ProviderEvent = $provider.events | Where-Object {($_.ID -eq 4)}

to query the event log, but in my .evtx, there are multiple events with same ID.

Hence, my question is - how to pin point to an individual event, (using what fields)?

检查RecordId属性:

$provider.events | Where-Object {$_.ID -eq 4} | foreach {$_.RecordId}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM