Hey ADRookie
To cap the size of your Sysmon folder and avoid those pesky disk volume alerts, you can use a combination of built-in Windows tools and a scheduled task.
Firstly create a PowerShell script (eg- CapSysmonSize.ps1
)
$sysmonPath = "C:\Sysmon" $maxSizeGB = 10 # Set your desired maximum size in gigabytes $sysmonSizeGB = (Get-ChildItem -Path $sysmonPath -Recurse | Measure-Object -Property Length -Sum).Sum / 1GB if ($sysmonSizeGB -gt $maxSizeGB) { Get-ChildItem -Path $sysmonPath -Recurse | Sort-Object LastWriteTime | Select-Object -First 1 | Remove-Item -Force }
Then open Task Scheduler on your server and Create a new task, and in the Actions tab, set the action to "Start a program.
Point it to powershell.exe
with arguments
-NoProfile -ExecutionPolicy Bypass -File "C:\Path\To\CapSysmonSize.ps1"
Finally Configure the trigger based on your desired schedule (e.g., daily, weekly).
This script checks the size of your Sysmon folder and, if it exceeds the specified limit, removes the oldest file until it's within the size limit. Adjust the script and scheduled task parameters based on your needs. If this helps kindly accept the answer thanks much.