AutomoxAutomox

Worklet: Windows Event Viewer - Output Application and System Errors to Activity Monitor

djvj
February 11, 2021 at 3:44 pm UTC

Gets the 10 most recent SYSTEM and APPLICATION errors from the Windows Event Viewer logs and outputs them into the Automox Activity Monitor

Evaluation Code

1 line
exit 1

Remediation Code

powershell22 lines
### Gets the 10 most recent SYSTEM errors from the event viewer logs

Write-Host "10 Most Recent SYSTEM Log Errors"

$A = Get-EventLog -LogName System -EntryType Error -Newest 10

Foreach ($B in $A){
    "`---"
    $B | Select-Object -Property TimeGenerated, EventID, EntryType, Message, Source
}


### Gets the 10 most recent APPLICATION errors from the event viewer logs
"`---" 
Write-Host "10 Most Recent APPLICATION Log Errors"
"` "
$A = Get-EventLog -LogName Application -EntryType Error -Newest 10

Foreach ($B in $A){
    "`---" 
    $B | Select-Object -Property TimeGenerated, EventID, EntryType, Message, Source
}

From there you can read in the activity monitor, or copy and paste into a text editor and

find:
---

replace with:
---

To get a cleaner view.

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack