In most circumstances you have to increase the ConfigMgr client cache size higher than the default of 5120MB. This is not uncommon, and there are alot of easy ways to modify it either during deployment, manually afterwards, or by script. There is one limitation to this though, what if you need to substantially increase the cache size? It can become difficult to do this when you need to increase it above 100GB. I had some issues with this a few months back, and after a case with Microsoft, found the only way to do it was via a PowerShell script. Even .vbs calling the same WMI methods for some reason would not work, but PowerShell came to save the day.
I put together a simple parameterized script that allows you to specify the size or it will default to 51200MB.
1 |
CacheSize.ps1 -CacheSize 153600 |
The full script is below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# # Script Name: Set ConfigMgr Cache Size # Author: Daniel Ratliff # Description: This script will update Configuration Manager Client cache size to the specified disk space. # param( [int] $cachesize = 51200 ) $cache = Get-WmiObject -Namespace root\ccm\SoftMgmtAgent -Class CacheConfig write-host "Current SCCM Cache Size:"$cache.size"MB." -foregroundcolor cyan write-host "" if ($cachesize -ge 51200) { write-host "Changing SCCM Cache Size to $cachesize MB..." -foregroundcolor cyan $cache.Size = $cachesize $cache.Put() | out-null write-host "Restarting CCMEXEC service..." -foregroundcolor cyan restart-service ccmexec write-host "Current SCCM Cache Size: "$cache.size -foregroundcolor green } elseif ($cachesize -lt 51200) { write-host "Changing SCCM Cache Size to 51200 MB..." -foregroundcolor cyan $cache.Size = 51200 $cache.Put() | out-null write-host "Restarting CCMEXEC service..." -foregroundcolor cyan restart-service ccmexec write-host "Current SCCM Cache Size: "$cache.size -foregroundcolor green } |
Please note, in order for the settings to take effect the SMS Agent Host/ccmexec service must restart, but the script does it for you!
Nice! Thanks!