SCCM ccmcache folder Cleanup

Question

Hello,

What is the best and recommended way to cleanup ccmcache folder. Please help with the script to perform cleanup using sccm.

solved 0
krisyada1989 4 months 9 Answers 138 views Beginner 0

Answers ( 9 )

  1. Thank you for the clarification.. I have noticed data more than 10 GB in the ccmcache folder so that’s why planning to cleanup to avoid disk space issue.

    • By default, the cache is set at 5GB or 5120MB. Did you guys increase that to 10GB?

    • I understand your issue, I have faced the same problem as the size of ccmcache depends on different environments due to package sizes.

      1. If you are facing low disk space issue then you should get a script created to get content cleaned, try the below script posted at technet, i have used it and it works great.

      https://gallery.technet.microsoft.com/scriptcenter/Clean-up-your-C-Drive-bc7bb3ed

      2. Deleting ccmcache content is not the best practice but If you still want to go ahead with ccmcache cleanup then i would suggest to use a baseline and set its schedule accordingly, also mention the days older than ‘xx’ should be removed.
      User the powershell option while creating Configuration Item.

      #discovery script
      $MinDays = ‘No of days’
      $UIResourceMgr = New-Object -ComObject UIResource.UIResourceMgr
      $Cache = $UIResourceMgr.GetCacheInfo()
      ($Cache.GetCacheElements() |
      where-object {[datetime]$_.LastReferenceTime -lt (get-date).adddays(-$mindays)} |
      Measure-object).Count

    • I understand your issue, I have faced the same problem as the size of ccmcache depends on different environments due to package sizes.

      1. If you are facing low disk space issue then you should get a script created to get content cleaned, try the below script posted at technet, i have used it and it works great.

      https://gallery.technet.microsoft.com/scriptcenter/Clean-up-your-C-Drive-bc7bb3ed

      2. Deleting ccmcache content is not the best practice but If you still want to go ahead with ccmcache cleanup then i would suggest to use a baseline and set its schedule accordingly, also mention the days older than ‘xx’ should be removed.
      User the powershell option while creating Configuration Item.

      #discovery script
      $MinDays = ‘No of days’
      $UIResourceMgr = New-Object -ComObject UIResource.UIResourceMgr
      $Cache = $UIResourceMgr.GetCacheInfo()
      ($Cache.GetCacheElements() |
      where-object {[datetime]$_.LastReferenceTime -lt (get-date).adddays(-$mindays)}|
      Measure-object).Count

      Best answer
  2. I think the cleanup will happen automatically …its built in and also i guess it ensures the downloaded content will remain at least 24 hrs in ccmcache folder and based on usage and the age it will automatically cleanup

  3. Hi,

    My question is why you want to delete the ccmcache folder. By default sccm will delete the old and aged content from the ccmcache folder when the client needs cache requriments.

    Thanks
    karthikeyan

  4. Hello, Check the article for details https://www.anoopcnair.com/sccm-cache-clean-up-script-download/

    + Download SCCM Cache Clean Up Script – This script will delete the CCM folder which is beyond specific size

Leave an answer

Sorry, you do not have a permission to answer to this question .