MyKE / Export all available Windows Event Logs via PowerShell

Created Mon, 05 Jun 2023 11:41:24 +0000

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
}