Windows
View all Worklets
WindowsWindows

Get Free Disc Space

Reports available disk space on all Windows drives and alerts when space falls below a configurable threshold

Worklet Details

What the disk space monitoring Worklet does

This Automox Worklet™ monitors free disk space across all logical drives on Windows endpoints and reports the percentage of available storage. The Worklet uses Windows Management Instrumentation (WMI) to query each drive's total size and free space, then calculates the percentage remaining.

By default, the Worklet flags endpoints as non-compliant when free disk space drops below 10 percent. You can adjust the minimum free space threshold (0-100 percent) through the $minimumFreeSpace parameter in the remediation script to match your organization's storage policies.

The Worklet queries only logical drives (DriveType 3) with a defined size, verifying it monitors only actual storage volumes and ignores network drives or undefined partitions.

Why monitor disk space on your endpoints

Insufficient disk space directly impacts endpoint stability, security patching, and user productivity. Operating system updates, security patches, and software installations all require temporary storage space. When disk capacity becomes constrained, these critical operations may fail, leaving endpoints vulnerable or causing service disruptions.

Low disk space also degrades system performance. Windows uses disk space for virtual memory (paging), temporary files, and system caches. When available space drops, the operating system struggles to manage these functions efficiently, resulting in slower response times and reduced application performance.

Proactive disk space monitoring allows you to address capacity issues before they cascade into outages. You can identify endpoints with chronic storage issues, plan capacity upgrades, and implement cleanup policies before critical failures occur.

How disk space evaluation and remediation works

  1. Evaluation phase: Checks for the SoftwareDistribution directory (Windows Update cache) to verify the endpoint is operational. Uses Get-CimInstance to query all Win32_LogicalDisk objects, iterates through each drive with a defined size, calculates free space percentage, and compares against the configurable minimum threshold (default 10 percent).

  2. Remediation phase: Reports the current free space percentage on the endpoint and generates an alert if any drive falls below the threshold. Outputs the warning status to the console with both current and threshold values, allowing administrators to identify which endpoints require cleanup or capacity expansion.

Disk space monitoring requirements

  • Windows 7 or later (including Windows 11 and Windows Server editions)

  • PowerShell 3.0 or higher (built into Windows 7 SP1 and later)

  • Windows Management Instrumentation (WMI) service enabled and accessible

  • Configurable parameter: $minimumFreeSpace (integer 0-100, default 10) to set your organization's disk space threshold

  • FixNow compatible for immediate on-demand evaluation and remediation

Expected disk space compliance state

After running this Worklet, endpoints are marked compliant when all logical drives maintain free disk space at or above your configured threshold. The Worklet outputs the actual free space percentage to the console, allowing you to verify current capacity and plan cleanup or expansion activities.

Non-compliant endpoints receive a warning message specifying which drives have insufficient space and how far below the threshold they are. This enables targeted remediation: you can deploy cleanup scripts to non-compliant endpoints, schedule user communications about disk space best practices, or coordinate with users to archive old files and free capacity.

How to validate get free disc space changes

  1. Run this Worklet on a pilot Windows endpoint and review evaluation output for get free disc space.

  2. Confirm Automox activity logs show successful completion and exit code 0.

  3. Verify endpoint state using checks aligned to evaluation script logic, such as Test-Path.

  4. Validate remediation effects from script operations such as Get-CimInstance, Write-Output, then rerun evaluation for compliance.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets