fix: update auditing logic in WELA.ps1 to differentiate between 'No Auditing' and 'Disabled' settings

This commit is contained in:
fukusuket
2025-11-02 00:48:05 +09:00
parent f30868aa10
commit 4fdf712dbf

View File

@@ -5222,8 +5222,8 @@ function AuditLogSetting {
if ($outType -eq "std") { if ($outType -eq "std") {
$auditResult | Group-Object -Property Category | ForEach-Object { $auditResult | Group-Object -Property Category | ForEach-Object {
$enabledCount = ($_.Group | Where-Object { $_.CurrentSetting -ne "No Auditing" } | ForEach-Object { $_.Rules.Count } | Measure-Object -Sum).Sum $enabledCount = ($_.Group | Where-Object { $_.CurrentSetting -ne "No Auditing" -and $_.CurrentSetting -ne "Disabled" } | ForEach-Object { $_.Rules.Count } | Measure-Object -Sum).Sum
$disabledCount = ($_.Group | Where-Object { $_.CurrentSetting -eq "No Auditing" } | ForEach-Object { $_.Rules.Count } | Measure-Object -Sum).Sum $disabledCount = ($_.Group | Where-Object { $_.CurrentSetting -eq "No Auditing" -or $_.CurrentSetting -eq "Disabled" } | ForEach-Object { $_.Rules.Count } | Measure-Object -Sum).Sum
$out = "" $out = ""
$color = "" $color = ""
if ($disabledCount -eq 0 -and $enabledCount -ne 0){ if ($disabledCount -eq 0 -and $enabledCount -ne 0){