Skip to content

Instantly share code, notes, and snippets.

@keithbloom
Created October 30, 2011 07:37
Show Gist options
  • Save keithbloom/1325659 to your computer and use it in GitHub Desktop.
Save keithbloom/1325659 to your computer and use it in GitHub Desktop.
ReadingEventLogFromPowerShell
$e = get-wmiobject -computerName 'SERVER' -query "SELECT * FROM Win32_NTLogEvent WHERE (logfile='application') AND (type='warning')"
$e | Where { $_.Message -match "websitename" } | Select * -First 5 | Sort TimeGenerated -desc | fl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment