CPU monitor and trigger to collect Logs
# ============================================================================ # Trend Micro Diagnostic Auto Collection on High CPU # ============================================================================ # Configuration $CpuThreshold = 90 # CPU % $ConsecutiveBreaches = 5 # Number of consecutive checks $CheckIntervalSeconds = 60 # Check interval $CooldownMinutes = 30 # Wait before next collection # Paths $TrendPath = "C:\Program Files\Trend Micro\Deep Security Agent" $DiagCommand = "dsa_control.cmd" $LogFolder = "C:\temp" # Create log folder if needed if (!(Test-Path $LogFolder)) { New-Item -Path $LogFolder -ItemType Directory -Force | Out-Null } $LogFile = Join-Path $LogFolder "TrendMicro_CPU_Monitor.log" # Log Function function Write-Log { param([string]$Mes...