#
Win-Storage Intune Detection and Remediation
Provides detection and remediation scripts, for performing deep disk space cleanup on Windows devices.
This landing page provides a concise entry point and links to focused pages for configuration, logic, deployment and troubleshooting.
See the sub-pages in this folder for full details:
- Detection
- Remediation
- Example logs (full samples)
- Intune setup & deployment
- Function reference
- Troubleshooting & logging
- References
- Changelog
#
On this page
Quick start Before you begin Credits
#
Quick start
# Full run (requires elevated prompt)
.\intune\remediation\Win-Storage-Remediate.ps1 -Verbose
For developer and operator guidance, use the links above. This file is intentionally short to make the site navigation easy to use.
#
Before you begin
Important
Use as one part of an overall device disk space management strategy
This script is just one of the tools needed in your toolbox for keeping disk usage on your Windows Intune devices under control.
There is no single method available within Intune to achieve this outcome and remove all system and other on your devices.
Whilst this script incorporates the efforts of the following remediations, always make your own evaluations and determinations on the best approach for keeping end user device disk space utilisation your tenant under control:
- Automatically Delete Old User Profiles using Intune - Prajwal Desai
- How to Configure Storage Sense using Intune - Prajwal Desai
Important
This script as designed will archive the contents of all log files specified in $logsToClear
Please ensure you are aware of the implications and impacts of this, and ensure log file selection is performed accordingly.
If using this approach in a Corporate or Enterprise environment - always ensure your relevant Information Security professionals are included as part of a proper ITIL or other appropriate Change Management approach, for choosing what logs to archive and clear on the computers being targeted by this script, and understanding/managing any consequences this may have to your Security Monitoring approach and posture.