Advertisement
guyrleech

Save all Windows events in given date range to csv file

Nov 18th, 2019
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Get-WinEvent -ListLog * |Where-Object { $_.RecordCount }|%{ Get-WinEvent -ErrorAction SilentlyContinue -FilterHashtable @{logname=$_.logname;starttime='14:14 12/11/19';endtime='23:59 15/11/19'}}|Select-Object -property * -ExcludeProperty ?*Id,Version,Qualifiers,Level,Task,OpCode,Keywords,Bookmark,*Ids,Properties|sort-object -property TimeCreated|Export-csv -Path service.hung.events.csv -NoTypeInformation -NoClobber
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement