Kaseya Community

Record Storage Space

  • I have set up Kaseya to run a procedure to clean up temp folders in the computer after the storage space reaches a certain threshold. I would like to provide my clients with information on how much data we cleaned up from their computers automatically. What would be the best way to go about this? I was thinking of maybe making the Low Disk alert run a procedure that records the disk usage at that moment, runs cleanup and then records again, but I'm not sure how to go about this.

    Anyone have any ideas? Thank you!

  • I have seen a few different approaches.  One of the scripts executed like this (pseudo-code):

    Record current disk space via command > output value > execute cleanup by your preferred method > Record current disk space via command > output value > report before/after automation.

  • We use a cleanup VBS script when dries get below 10% on alert, then run script.

    We use the following VBS command to get current drive space

    ' Get current free space on system drive

    initialFreeSpace = CDbl(sysDrv.FreeSpace)

    Then write the difference to a log file

    f.WriteLine "Freed " & CLng( CDbl(CDbl(sysDrv.FreeSpace) - CDbl(initialFreeSpace))/CDbl(1024*1024)) & " megabytes."

    File log stored in agent documents for reference to techs and clients



    Cleans all profiles' temp and IE cache folders

    A whole subfolder deletion is indicated by \

    A file deletion is indicated by ,

    A whole subfolder deletion failure is indicated by X

    A file deletion failure is indicated by x


    Processing folder: C:\windows\Logs\CBS

    Process "TrustedInstaller.exe" process not found

    Deleting contents of CBS Log Files


    Processing folder: C:\windows\Temp


    Processing folder: C:\windows\system32\wbem\Logs

    Processing folder: C:\windows\Debug


    Processing folder: C:\windows\PCHEALTH\ERRORREP\UserDumps

    Processing folder: C:\ProgramData\Microsoft\Windows\WER\ReportQueue

    Deleting C:\windows\Prefetch\*.pf

    Deleting C:\windows\syswow64\temp.txt

    Deleting C:\windows\system32\temp.txt

    Deleting C:\$Recycle.Bin

    Running the Advanced Windows Disk Cleanup Utility

    Freed 314 megabytes.

    Cleanup has been completed.  Review log file in Kaseya Agent Documents folder MTSCate.2.0.log for details.

  • Our maintenance tools include a disk cleanup that logs the start, end, and change in free space, and logs every file that was touched, whether deleted or not. It handles every temp location (including user temp and temp Internet files), Recycle bins, plus any additional folders you specify.


  • +1 for MSPbuilders toolset. You can get creative on reporting on the logs as well depending on your use case

    I personally prefer pulling them to kserver via agent procedures & using variables to organize + rename them. Then using powershell + powerbi to create nice pretty client facing reports
  • Michael,

    Our  next release will focus on better reporting from Smart Monitors. The goal is to provide better visibility into the localized automation process. The disk cleanup is from Daily Maintenance - would you like these tools to provide summary alerts as well?

    We have a special alert class that the Intelligent Ticket Processor identifies and writes to a log without passing to the PSA as a ticket. These will go to a CSV file by default or a customer-provided SQL database. From there, this data will be available for any type of reporting (developed by the MSP).

    We're considering the following, since we already have all the data on each agent:

    • Any Smart Monitor self-remediation that prevents a ticket, such as disk space cleanup, Antivirus Def update, time-sync correction or re-configuration.
    • Disk Capacity Smart Monitor can report 30-day trending per volume, free space bytes/percent.
    • The Disk Cleanup maintenance tool can provide summary info - start free, bytes reclaimed, end free.
    • We write a TON of data to the logs - any of which can be collected by procedure or brought back for ITP processing.
    • The Daily Audit collects over 100 data points, 34 of which are brought back to custom fields. Any or all can be captured and processed by ITP.

    Now's a good time to submit ideas and get your votes in! :)