Search code examples
powershellreportingevent-log

Collect EventLog hourly into a single file


Is it possible to collect EventLog entries every hour and then save it into a single file in PowerShell?


Solution

  • Use the Get-EventLog cmdlet to retrieve the logs, save it to a file using the Out-File cmdlet and schedule your script using the New-ScheduledTask cmdlet.