Skip to content

Instantly share code, notes, and snippets.

@arebee
Created June 2, 2016 17:58
Show Gist options
  • Save arebee/ca2d2cbe1dc02e1f00dd4f18e2eef1c1 to your computer and use it in GitHub Desktop.
Save arebee/ca2d2cbe1dc02e1f00dd4f18e2eef1c1 to your computer and use it in GitHub Desktop.
PowerShell snippet to scan the Windows Event Log
Get-EventLog -LogName System -newest 100 | where {$_.EventID -match '1001|1003'} | %{ $_.Message }
# or
Get-EventLog -LogName application -Newest 1000 | where {$_.EventID -match '1001|1003'} | select timewritten, message | % {
Write-Host "`n$('*'*80)"
Write-Host $_.message
)
# or
Get-EventLog -LogName application -Newest 1000 | where {$_.EventID -match '1001|1003'} | select timewritten, message | where $_.message -match 'bluescreen' | % {
Write-Host "`n$('*'*80)"
Write-Host $_.message
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment