Profile Cleanup Utility

Old user profiles can quietly take up gigabytes of space—especially on shared machines or endpoints that cycle through multiple users. This script automates profile cleanup based on age and disk usage, making it easier to keep systems lean without risking essential folde
Key Features
Age-Based Cleanup – Deletes user profiles older than a set threshold (e.g. 30 days) to free up disk space.
Smart Threshold Adjustment – Dynamically tightens age limit (to 15 days) if free space remains low after initial cleanup.
Exclusion Handling – Skips system and admin folders to avoid unintended deletions.
Disk Space Awareness – Evaluates disk usage before and after cleanup to ensure meaningful impact.
Logging & Transparency – Records all removed profiles for review and audit purposes.
A small script with a big impact. Whether scheduled or run manually, it helps reclaim space and restore order—without breaking things in the process.
Description
Profile Cleanup Utility
3.7.2025
Deletes old user profile folders based on age and available disk space. Adjusts cleanup threshold dynamically, and logs deleted profiles.