This commit is contained in:
fukusuket
2025-03-13 23:32:56 +09:00
parent 684f32d034
commit 84b02884e9

View File

@@ -12,7 +12,7 @@ Write-Host $logo -ForegroundColor Green
# Step 1: Run the auditpol command using cmd.exe and redirect its output to a file # Step 1: Run the auditpol command using cmd.exe and redirect its output to a file
$outputFilePath = "auditpol_output.txt" $outputFilePath = "auditpol_output.txt"
Start-Process -FilePath "cmd.exe" -ArgumentList "/c chcp 437 & auditpol /get /category:* /r" -NoNewWindow -Wait -RedirectStandardOutput $outputFilePath -RedirectStandardError $outputFilePath Start-Process -FilePath "cmd.exe" -ArgumentList "/c chcp 437 & auditpol /get /category:* /r" -NoNewWindow -Wait -RedirectStandardOutput $outputFilePath
$auditpolOutput = Get-Content -Path $outputFilePath $auditpolOutput = Get-Content -Path $outputFilePath
$filteredOutput = $auditpolOutput | Select-String -NotMatch "No Auditing" $filteredOutput = $auditpolOutput | Select-String -NotMatch "No Auditing"
$extractedStrings = [System.Collections.Generic.HashSet[string]]::new() $extractedStrings = [System.Collections.Generic.HashSet[string]]::new()