# 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.

Refer to the menu pages (left) for full information on this script.

# On this page

  • Before you begin
  • Quick start
  • Quick operational note
  • Credits

# Before you begin

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.

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:

# 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.

# Quick operational note

This repository contains an enhanced remediation script that intentionally uses a "log-first" approach: detailed run-time entries (including per-user/profile details) are appended to a temporary per-run log file. The host console output intentionally emits only compact summaries (for example a user-profile pass will report "RemovedCount=X; FailedCount=Y") to avoid exposing PII and to keep Intune-captured output concise.

When testing or troubleshooting, run the script with a dry-run and verbose output to see more detail locally:

.\intune\remediation\Win-Storage-Remediate.ps1 -DryRun -Verbosity Verbose

Inspect the per-run temporary log (for example %TEMP%\<scriptName>_temp.log) for the full details of what would be removed.

# Credits