Filter Windows Event Log by Exception Message
In this post, I describe how you can filter the Windows Event Log by Exception Message. This allows you to see when and how often a particular exception has occurred.
The Get-EventLog PowerShell cmdlet can be used to get all the event log entries with an exception message containing the specified text, for example, the following command gets all the entries containing the text "The process cannot access the file":
Get-EventLog -LogName Application | Select Index, TimeGenerated, Message, Source | where {($_.Message -like "*The process cannot access the file*") -and ($_.Source
-like "ASP*")}
Comments
Post a Comment