SCCM Cache Management: Clearing Old CCMCache Content

If you’re using SCCM/Configuration Manager for software deployment, you may find that free disk space becomes an issue on machines with smaller SSDs — the more software users install from your Software Catalog, the more content accumulates in the local CCMCache. You can clear the CCMCache manually as needed, but you can also automate this […]

SCCM How To Clear Ccmcache Content Older Than X Days Using Compliance
If you’re using SCCM/Configuration Manager for software deployment, you may find that free disk space becomes an issue on machines with smaller SSDs — the more software users install from your Software Catalog, the more content accumulates in the local CCMCache. You can clear the CCMCache manually as needed, but you can also automate this using Configuration Manager’s Compliance Settings (Configuration Items/Baselines) to clean up cache content older than a set number of days, without needing a separate script deployment.

The Approach

  1. Create a new Configuration Item under Assets and Compliance > Compliance Settings > Configuration Items, targeting Windows devices.
  2. Add a setting of type Script, with a PowerShell discovery script that enumerates the CCMCache elements (via the UIResource.UIResourceMgr COM object’s GetCacheInfo() method) and checks each element’s last-referenced date against your threshold.
  3. Add a matching remediation script that removes cache elements older than the threshold using the same COM object’s DeleteCacheElement() method.
  4. Set the compliance rule to remediate non-compliant clients automatically, then deploy the baseline to a collection with a recurring evaluation schedule.
Because this touches the client cache directly, test the discovery and remediation scripts thoroughly against a pilot collection before deploying broadly — a badly-scoped remediation script could remove cache content still in active use by a pending deployment.

A Small Terminology Note, Plus Where Things Stand in 2026

One correction worth making: the original refers to end users installing software from your “Software Catalog” — the current official name for that self-service portal is Software Center, not Software Catalog (the latter is outdated terminology, easily confused with the long-retired web-based Application Catalog role from older ConfigMgr versions). On the substance: the Compliance Settings-based CCMCache cleanup approach described above is unchanged and still works identically on the current Configuration Manager release (2603) — the UIResource.UIResourceMgr COM object and its GetCacheInfo()/DeleteCacheElement() methods remain the standard scripting interface for this.

Resources

🛠️

Gear We Recommend

Testing configs is easier with a dedicated admin machine set up right. Here’s the kit we use.

Browse our Windows Admin Toolkit picks on Amazon

As an Amazon Associate, TechyGeeksHome earns from qualifying purchases.


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.