How to Configure or Clear SCCM Client Cache

If you need to clear the SCCM client cache or increase the cache size on individual clients, there are a few different ways to do it. One of the methods usually posted on a lot of blogs and forums is actually the wrong way to do it, because it requires restarting the CCMEXEC process on the client in order to update the new cache settings, which makes the task sequence used to deploy the script fail since CCMEXEC, which was running the deployment, has been terminated.

Here I will show you the right way to clear the CCM cache that does not require restarting the CCMEXEC process. This PowerShell script can be deployed with SCCM as a package or as part of a task sequence. Sometimes this method is preferable to using Right Click Tools, especially if you want to only change cache settings during application deployment, such as part of a task sequence that installs multiple large applications. Sometimes it doesn’t make sense to keep 30GB of installers cached on the computer and it’s better to just manually flush the cache after the installation completes.

Here is the script to clear the ccmcache:

And here is the script to change the size of the ccmcache:

In this example, I am setting the cache to 10GB. The TotalSize property is in MB.

These are two separate scripts that have no dependencies on each other. Each can be deployed as its own package in SCCM.

4 thoughts on “How to Configure or Clear SCCM Client Cache”

  1. Pingback: SCCM Client Cache Configuration Improved Powershell Script | BorisKagan.net

  2. I have run this script locally with the Admin account and it works perfectly. I absolutely will not run from a package. The logs say it ran with no errors but no folders or files are deleted from the ccmcache folder. Any idea why this may be? I have the package set to run with admin privileges and it is set whether user is logged in or not. Has anyone else had this issue?

  3. I’m having the same issue as Ken. When this program is a package, running as admin, it runs without any errors, but nothing actually gets deleted. I wonder if the ccmcache goes into a locked state when an application/package is actually deploying? This is a package… which tries to delete itself, essentially. I can see why this wouldn’t work. But I’m still looking for a solution to allow users without admin rights to delete their own CCM cache folders.

Leave a Reply to Ken Cancel Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.