SHARE
TWEET

Untitled

a guest May 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $provider = get-winevent -ListProvider *
  2. $Collection =@()
  3. foreach ($entry in $provider)
  4.     {
  5.     foreach ($object in $entry.events)
  6.        {
  7.        foreach ($log in $entry.LogLinks.LogName)
  8.             {
  9.             [xml]$data = $object.Template
  10.             foreach ($DataType in $data.template.data.name)
  11.                 {
  12.                 $Props = @{
  13.                     'LogName' = $log
  14.                     'Provider' = $entry.Name
  15.                     'ID' = $object.Id
  16.                     'Data Type' = $DataType
  17.                     }
  18.                 $TotalObjects = New-Object PSCustomObject -Property $Props
  19.                 $Collection += $TotalObjects
  20.                 }
  21.             }
  22.         }
  23.     }
  24. $Collection|Export-Csv -Path c:\temp\EventDataTypes.csv -NoTypeInformation
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top