How to Clear a CCM Cache

The Windows System Center Configuration Manager (SCCM) is an incredibly useful tool in office settings. An organization's IT department or systems administrators can use it to ensure that all employees or team members have access to the applications and security they need to complete tasks and perform assigned roles, whether they're using a company device or a personal device.

Image Credit: kasipat/iStock/GettyImages

SCCM can also be used to install programs and deploy patches across a network of computers, but in certain environments, this can present a problem. Temporary files used in deployment can occasionally persist on networked devices, leading to file bloat on client hard drives and a storage crisis on the deployment server itself. These files are stored in the Windows CCM cache (also known as the CCMCache). This cache can be cleared manually or by using PowerShell command scripts.

What Is the Windows CCM Cache?

The CCMCache is a file cache used by machines and servers networked together via SCCM. It functions like any other computer cache, storing temporary files related to installed programs and system updates, but due to its relationship to the Administrative System Center, it cannot be cleared by users who lack administrator privileges. The CCMCache can be found in most Windows installations, Enterprise or otherwise, in the core Windows folder at c:\windows\ccmcache or in a hidden file inside the system32 folder.

Clearing the CCM Cache Manually

If you have administrator access to a computer, you can clear the CCM cache manually through that computer's Settings menus. To do this, access the Control Panel, either by selecting it from the Start Menu or by searching for it via the Windows Search bar. Use the menu at the top of the window to display options as icons and then scroll to the "Configuration Manager" option. Select it and click the "Advanced" tab. Navigate to "cache" and select "Configure Settings." Click the "Delete Files" button that appears and confirm the action.

Cache Clearing With PowerShell

If you need to clear the CCMCache folder on a number of computers at the same time or need to do so remotely, you can use a PowerShell script. First, navigate to the computer you want to clear in the SCCM control panel and right-click on it. Select the "Right click tools" option, followed by "Console Tools" and finally "Interactive PowerShell prompt." You can then input a script command of your choice. Many scripts exist to clear the CCM Cache, each varying in complexity and intended for different network environments. However, running the following string of code should clear the CCM cache in most systems:

$resman= New-Object -ComObject "UIResource.UIResourceMgr"

$cacheInfo=$resman.GetCacheInfo()

$cacheinfo.GetCacheElements() | <g class="gr_ gr_46 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling" id="46" data-gr-id="46">foreach</g> {$cacheInfo.DeleteCacheElement($_.CacheElementID)}

$resman= New-Object -ComObject "UIResource.UIResourceMgr" $cacheInfo=$resman.GetCacheInfo() $cacheinfo.GetCacheElements() | <g class="gr_ gr_46 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling" id="46" data-gr-id="46">foreach</g> {$cacheInfo.DeleteCacheElement($_.CacheElementID)}
references