Export all available Windows Event Logs via PowerShell

If you need to export all available Windows Event Logs, especially in the Windows Server Core edition (without GUI), you can utilize this PowerShell script:

$EventViewerLogs = wevtutil el
$Destination = "C:\temp\Events"

$EventViewerLogs | ForEach-Object {
    Write-Host "Exporting log $($_) into $Destination\$LogPathExportName.evtx"
    $LogPathExportName = $_ -replace "/","__"
    wevtutil.exe epl $_ $Destination\$LogPathExportName.evtx
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.