Skip to content

Commit

Permalink
add $Skip
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyPhipps authored Nov 13, 2024
1 parent 6f6e052 commit 230626b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Modules/Get-EventCounts.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Get-EventCounts {
}
.NOTES
Updated: 2024-06-03
Updated: 2024-11-13
Contributing Authors:
Anthony Phipps
Expand Down Expand Up @@ -86,7 +86,10 @@ function Get-EventCounts {

process{

$Logs = Get-WinEvent -ListLog * -ErrorAction SilentlyContinue | Where-Object { ($_.RecordCount -gt 0) }
# Skip logs that have been observed taking an unacceptable amount of time, which you may also be getting logs for anyway and can do counts in a SIEM.
$Skip = "Security", "Microsoft-Windows-Sysmon/Operational", "Microsoft-Windows-PowerShell/Operational", "Windows PowerShell", "Microsoft-Windows-TaskScheduler/Operational"

$Logs = Get-WinEvent -ListLog * -ErrorAction SilentlyContinue | Where-Object { ($_.RecordCount -gt 0 -and $_.LogName -notin $Skip) }

$EventsArray = Foreach ($Log in $Logs){

Expand Down

0 comments on commit 230626b

Please sign in to comment.