Created
June 2, 2016 17:58
-
-
Save arebee/ca2d2cbe1dc02e1f00dd4f18e2eef1c1 to your computer and use it in GitHub Desktop.
PowerShell snippet to scan the Windows Event Log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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