Counting log results in Powershell

前端 未结 1 1469
野的像风
野的像风 2021-01-22 09:03

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

1条回答
  •  迷失自我
    2021-01-22 09:55

    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...
    

    0 讨论(0)
提交回复
热议问题