I have an assignment where I have to pull information like \"Audit Failure\" & \"Audit Success\" from my Windows security log file and count the results of each ex. total a
Try Group-Object
. Here is an example of grouping on property EntryType
to get the count of successes and failures:
Get-EventLog -LogName Security | Group-Object -Property EntryType
Count Name Group
----- ---- -----
21911 FailureAudit {System.Diagnostics.EventLogEntry, System.Di...
14132 SuccessAudit {System.Diagnostics.EventLogEntry, System.Di...