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.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Hello,
What is the best and recommended way to cleanup ccmcache folder. Please help with the script to perform cleanup using sccm.
Answers ( 9 )
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
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
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
I agree cache is automatically managed by SCCM ..no need to delete it manually
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
+ You can also use compliance settings described By Eshwar
http://eskonr.com/2016/08/sccm-configmgr-how-to-clean-ccmcache-content-older-than-x-days-using-compliance-settings/