Last few weeks I’ve been implementing a MED-V solution at a customer.
Since this customer is using SCCM for deployment of their client OS and applications, they wanted me to deploy the MED-V solution by using SCCM. This went without any hickups, with one exception.
By default the SCCM Client cache is set to 5GB. My problem with this was that my MED-V image was about 17GB!
Since the size of the client cache can only be configured when you install the SCCM client on the device, and can not be changed by a simple registry value, I started scripting.
This is what I came up with… and found it extremely useful since I had to change the size of the client cache in the entire environment!
args = WScript.Arguments.Count
If args < 1 then
WScript.Echo "usage: sccmcache.vbs [New size in MB] "
WScript.Quit
end If
strComputer = "."
intCacheSize = WScript.Arguments.Item(0)
Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/ccm/SoftMgmtAgent")
Set colItems = objWMIService.ExecQuery("Select * from CacheConfig")
For Each objItem in colItems
objItem.Size = intCacheSize
objItem.Put_ 0
wscript.echo "The SCCM cache size on " & UCase(strComputer) & " located at " & objItem.Location & " will be changed to: " & objItem.Size & " MB"
Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service Where Name = ‘CCMExec’")
For Each objItem in colItems
objItem.StopService(strServiceName)
Wscript.Sleep 10000
objItem.StartService(strServiceName)
Next
wscript.echo "The SCCM cache size on " & UCase(strComputer) & " located at " & objItem.Location & " has been changed to: " & objItem.Size & " MB"

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 