PowerShell to change ConfigMgr Client Cache size

Don Hite has a VBS Script To Change A Remote SMS Clients Cache Size, but I wanted to do it with PowerShell:

$Cache = Get-WmiObject -namespace root\ccm\SoftMgmtAgent -class CacheConfig$Cache.size = 10240$Cache.InUse = "True"$Cache.Put()Restart-Service ccmexec

I added line 3 after trying the size change and the bottom of the Advanced tab on the ConfigMgr control panel was greyed out (on a Windows Vista SP1 client).

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .