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*")}

Screenshot showing the Windows event log entries with the specified exception message

Comments

Popular posts from this blog

LG TV This app will now restart to free up more memory

LG TV Clear All Browsing History Data

Excel Import CSV not using "Use First Row as Headers"