Powershell parse get-winevent into csv with headers including all child objects Powershell parse get-winevent into csv with headers including all child objects powershell powershell

Powershell parse get-winevent into csv with headers including all child objects


This was copied from an edit to the question itself, and should be credited to the original question author

Ok, I finally figured it out...At least for what I need to accomplish. Hopefully this will help someone.

    Get-WinEvent -Path .\Security.evtx | select TimeCreated, ProviderName, Id, @{n='Message';e={$_.Message -replace '\s+', " "}} | Export-Csv .\Logging.csv

This code allows you to export the archived eventlog into csv with headers and puts the whole message body into one cell, which allows import into a database with ease when you have no tools to work with.