-
-
Save sasqwatch/1ff8b935fb9f56c58059053526d82146 to your computer and use it in GitHub Desktop.
Get data types for event logs
This file contains hidden or 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
$provider = get-winevent -ListProvider * | |
$Collection =@() | |
foreach ($entry in $provider) | |
{ | |
foreach ($object in $entry.events) | |
{ | |
foreach ($log in $entry.LogLinks.LogName) | |
{ | |
[xml]$data = $object.Template | |
foreach ($DataType in $data.template.data.name) | |
{ | |
$Props = @{ | |
'LogName' = $log | |
'Provider' = $entry.Name | |
'ID' = $object.Id | |
'Data Type' = $DataType | |
} | |
$TotalObjects = New-Object PSCustomObject -Property $Props | |
$Collection += $TotalObjects | |
} | |
} | |
} | |
} | |
$Collection|Export-Csv -Path c:\temp\EventDataTypes.csv -NoTypeInformation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment