Last active
April 28, 2023 03:51
-
-
Save AlexAsplund/bf5eeed019cffb5ffe9970e902c83d66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Publishers = wevtutil ep | |
# Mååånga fel, antagligen pga. att inte eventet är dokumenterat OK hos provider | |
$ErrorActionPreference = "SilentlyContinue" # Shh sh sh | |
$AllEventData = Foreach($Publisher in $Publishers){ | |
[XML]$Events = wevtutil gp $Publisher /ge /gm:true /f:xml | |
$Events.provider.events.event | Foreach { | |
[PSCustomObject]@{ | |
event_id = $_.value | |
publisher = $Publisher | |
channel = $_.channel | |
task = $_.task | |
level = $_.level | |
message = $_.message | |
short_message = $_.message -replace "(^[^.]+).*",'$1' | |
} | |
} | |
} | |
$AllEventdata | ConvertTo-CSV -NoTypeInformation | Out-File C:\temp\event_descriptions.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment