Tuesday, March 18, 2014

SCCM 2012: change client cache size

Today another SCCM blog!
This time it's about how to change the default cache size on the client. Normally it is 5120 MB, but in some cases, you deploy (multiple) packages which require more space.

There are several ways to change the cache size. First, you can give a parameter when installing the agent. The parameter is SMSCACHESIZE=xxxx, where xxxx is the number of MB's the new cache size will become.

Here is a detailed description from TechNet:

Specifies the size of the client cache folder in megabyte (MB) or as a percentage when used with the PERCENTDISKSPACE or PERCENTFREEDISKSPACE property. If this property is not set, the folder defaults to a maximum size of 5120 MB. The lowest value that you can specify is 1 MB.
If a new package that must be downloaded would cause the folder to exceed the maximum size, and if the folder cannot be purged to make sufficient space available, the package download fails, and the program or application will not run.
This setting is ignored when you upgrade an existing client and when the client downloads software updates.
Example: CCMSetup.exe SMSCACHESIZE=100
If you reinstall a client, you cannot use the SMSCACHESIZE or SMSCACHEFLAGS installation properties to set the cache size to be smaller than it was previously. If you try to do this, your value is ignored and the cache size is automatically set to the last size it was previously. 
For example, if you install the client with the default cache size of 5120 MB, and then reinstall the client with a cache size of 100 MB, the cache folder size on the reinstalled client is set to 5120 MB. 


However, sometimes the SMSCACHESIZE parameter doesn't work. Another way to achieve the cachesize change, is by running a VB script. You can use it in a task sequence, or deploy it as an application.

The script should look something like this:

++++changecachesize.vbs++++
On Error Resume Next
 Set oUIResource = CreateObject("UIResource.UIResourceMgr")
Set objCacheInfo = oUIResource.GetCacheInfo
 nValueToSet = wscript.arguments(0)

 objCacheInfo.TotalSize = nValueToSet


The commandline how it should be used (should be run as administrator):

EXAMPLE: changecachesize.vbs 15360

The number at the end is the size in MB the cache size will be changed to.

Ofcourse it is also possible to change the cache size in the Configuration Manager node in the Control Panel. Open the Cache tab, and change the slider to the value you like.


Hopefully this will help to prevent any problems in your Configuration Manager 2012 environment!

No comments:

Post a Comment