r-Techsupport / Get-Specs

Windows Specifications script for rTechsupport
GNU General Public License v3.0
6 stars 4 forks source link

Pull crit events from event log #44

Open PipeItToDevNull opened 2 years ago

PipeItToDevNull commented 2 years ago

Likely pull then, get unique, then count

err_crit_log_MS_WINDOWS_TEST.txt

Change file to xml then import to event log

PipeItToDevNull commented 2 years ago

This works, but takes a long time and I see no simple way to get viewable data

Get-WinEvent -ListLog * | % { Get-WinEvent -LogName $_.Logname -MaxEvents 500 -ErrorAction SilentlyContinue | ? { $_.Level -le '2' | Select -Unique } }
PipeItToDevNull commented 2 years ago

https://www.reddit.com/r/PowerShell/comments/taf9hw/how_to_filter_windows_events/

TheKrol commented 2 years ago

$EventLog = Get-EventLog -LogName System -EntryType Error | ConvertTo-HTML -Fragment -PreContent "<h2 class='collapsible'> Error Events</h2>" I'm not sure if this is truly what you are looking for, maybe you can point me in the right direction image

PipeItToDevNull commented 2 years ago

How long did that take to run @TheKrol ?

TheKrol commented 2 years ago

Not long at all, it was very quick. It was less than 5 seconds