Find Event Log Entries with Specific Text
Problem
You want to retrieve all event log entries that contain a given term.
Solution
To find specific event log entries, use the GetEventLog cmdlet to retrieve the items, and then pipe them to the WhereObject cmdlet to filter them, as shown in Example 202.
Example 202. Searching the event log for entries that mention the term “disk”
PS >GetEventLog System | WhereObject { $_.Message match "disk" }
Index Time Type Source EventID Message
- Read more about Find Event Log Entries with Specific Text
- Log in or register to post comments