Skip to content

Instantly share code, notes, and snippets.

@h3nryza
Created July 17, 2018 17:37
Show Gist options
  • Select an option

  • Save h3nryza/2de4d58fbcc0fc387c08732552a15007 to your computer and use it in GitHub Desktop.

Select an option

Save h3nryza/2de4d58fbcc0fc387c08732552a15007 to your computer and use it in GitHub Desktop.
Powershell quick last 2 days auditlogs
Get-EventLog -LogName Application -After (Get-Date).AddDays(-2) -EntryType "Error" | export-csv .\ApplicationLog-Errors.csv
Get-EventLog -LogName Application -After (Get-Date).AddDays(-2) -EntryType "Warning" | export-csv .\ApplicationLog-Warnings.csv
Get-EventLog -LogName System -After (Get-Date).AddDays(-2) -EntryType "Error" | export-csv .\SystemLog-Errors.csv
Get-EventLog -LogName System -After (Get-Date).AddDays(-2) -EntryType "Warning" | export-csv .\SystemLog-Warnings.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment