Automatically Cleaning SCCM Client Cache

Donald-0332 160 Reputation points
2025-01-02T17:35:20.63+00:00

A "chicken and egg" problem is encountered when attempting to delete the SCCM cache using a script executed from within the SCCM cache itself.

Is there an automatic process in SCCM for cleaning up the client cache? What are the recommended methods for periodically managing and clearing the cache in SCCM?

Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
506 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AllenLiu-MSFT 47,316 Reputation points Microsoft Vendor
    2025-01-03T02:46:19.6933333+00:00

    Hi, @Donald-0332

    Thank you for posting in Microsoft Q&A forum.

    The SCCM client cache does not have an automatic process for cleaning up itself. However, the cache is managed by the Configuration Manager client, which does not automatically delete cached content unless new content requires its disk space. Cached content remains in the cache for a configured number of minutes after it is used. If the cache is full and new content needs to be downloaded, the client will attempt to download it again during the next retry interval, which occurs every four hours until it tries 18 times.

    To manage and clear the cache periodically, you can configure the cache settings during client installation or adjust them afterward in the Configuration Manager console. It is important to use the supported methods for deleting files in the cache, such as the "Delete Files" option in the Configuration Manager control panel, rather than manually deleting files from the cache folder.

    For more effective management, you can also adjust the size of the client cache without reinstalling the client by using the cache size settings available in Client Settings in the Configuration Manager console.

    For your references:

    Configure the content cache for Configuration Manager clients


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".


  2. Jon McCabe 5 Reputation points MVP
    2025-01-07T16:09:51.0033333+00:00

    Despite all your best efforts, you may find clients still exceeding the set size allow for the client cache. When this happens, you need to sometimes manually intervene. What I have done in the past is use the SCCM "Scripts" functionality instead of creating a "package".

    SCCM Scripts

    Just make sure to use the correct PS commands to clear the ccmcache, don't just "delete" it.
    I believe another way to manage this is with compliance baselines. You can have a PowerShell script check the size of the ccmcache and a remediation task to clean it up. Another way is simply remote PowerShell commands to clear it looping through a CSV file.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.