A ControlUp community member developed a native self-service disk cleanup solution for macOS and Windows users, designed to be triggered via ControlUp Edge DX without requiring IT intervention or external tools. The goal was to allow users to safely free disk space through a simple, native dialog that displays current disk usage and offers a checklist of safe-to-clean areas such as Trash, application caches, container caches, logs, Xcode build cache, and old temporary files. Each item is described in plain language and sorted by the space it occupies, allowing users to select and confirm the cleanup themselves.
On macOS, the dialog is implemented using only built-in osascript capabilities—no additional tools like swiftDialog or extra installations are necessary. For both macOS and Windows, the solution emphasizes safety by running a dry-run by default, excluding critical system folders and personal directories such as Documents, Downloads, Keychains, and SSH keys from cleanup. The cleanup operates within the context of the logged-in user, not root, ensuring user-specific data protection. After cleanup, the system verifies the amount of space reclaimed against the actual free volume.
Triggering this cleanup from an Edge DX alert, either automatically due to disk usage thresholds or on-demand, enables a small dashboard that reports on reclaimable and freed disk space, all without requiring elevated permissions, Intune writes, or admin consent. One of the more challenging technical aspects was delivering the cleanup dialog from a root-level agent into the user’s session, given the restrictions of macOS and Windows environments.
The community member shared that while the script could likely be optimized or shortened by more experienced developers, this version works reliably and safely. Detailed setup documentation is available by request. Additionally, to complement the cleanup tool, the developer created an analytics dashboard to track the cumulative space saved by the script. This solution offers a practical way for organizations using ControlUp Edge DX to empower their end users with safe, controlled disk cleanup capabilities, minimizing helpdesk workload without compromising disk security or user privacy.
For more on creating and managing custom alerts and actions within ControlUp Edge DX, consult the official documentation at https://docs.controlup.com/edge and explore ControlUp Academy at https://cuacademy.controlup.com for training on extending ControlUp functionality.
Read the entire ‘How to Implement Native macOS and Windows Self-Service Disk Cleanup via ControlUp Edge DX Without External Tools’ thread below:
A native macOS and Windows self-service disk cleanup for ControlUp Edge DX (no external tools)
Hi all,
spent last week on something I am a little proud of…
The idea: let Mac and Windows users clean their own disk, triggered from ControlUp, with no IT hands-on and no external tooling. Sounds simple. Then you try it on macOS and Windwos.
What I ended up with: a native dialog pops on the user’s Mac / Windows, shows how full the disk is, and offers a checklist of safe areas. Trash, app caches, container caches, logs, Xcode build cache, old temp files.
Each line says in plain words what it is and how much space it holds, biggest first. Tick, confirm, done. All drawn with plain osascript. No swiftDialog, no installs, nothing that is not already on every Mac.
The part I care about most is safety. Dry-run by default. A hard guard that blocks system folders and anything personal, Documents, Downloads, Keychains, ssh keys. It cleans the logged-in user, not root. And the freed number is verified against the real volume.
Triggered by an Edge DX alert on disk usage or on demand, with a small dashboard for reclaimable and freed space. Zero external permissions. No Intune write, no admin consent.
Honest read: getting a dialog from a root agent into the user’s session is where macOS / Windows makes you work. And yes, I lost an hour to a single apostrophe.
I am sure there are smarter brains here who would solve this in half the lines. If that is you, show me please. This is just my version, and it works.
Setup notes in a separate doc, happy to share (drop me a DM please )
Best,
Séb
P.S.: Oh, and because I love Analytics (yeah, I know, I am a weirdo…), attached a dashboard which reflects the saved space by this script.
You are the best!!! LOVE THIS! 🙂 Danke!!!
I am not, but thank you anyway
Bitteschön!!
Continue reading and comment on the thread ‘How to Implement Native macOS and Windows Self-Service Disk Cleanup via ControlUp Edge DX Without External Tools’. Not a member? Join Here!
Categories: All Archives, ControlUp Dashboards, ControlUp for Desktops, ControlUp Scripts & Triggers
