Skip to content

Instantly share code, notes, and snippets.

@jkbryan
Created March 8, 2019 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkbryan/feb0b065bf935e6284fee4258853a3b3 to your computer and use it in GitHub Desktop.
Save jkbryan/feb0b065bf935e6284fee4258853a3b3 to your computer and use it in GitHub Desktop.
Find strings like 'jon' or 'dave' in the security event log of a server named DC01.OHOLICS.NET
SELECT * INTO C:\TEMP\Output\output.csv
FROM \\DC01.OHOLICS.NET\security
WHERE TimeWritten > TIMESTAMP ( '2009-01-01 01:00:00', 'yyyy-MM-dd hh:mm:ss' ) AND SourceName = 'Microsoft-Windows-Security-Auditing' AND
( Strings LIKE '%jon%' OR strings LIKE '%dave%')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment