In this short post we will see how to get configuration manager client cache size using powershell. In one of my recent post we saw Configuration Manager 1606 Client Cache Settings overview. To brief about it, in version 1606 of Configuration manager you can manage the client cache size efficiently. There is no need of powershell or VB script to change the client cache size.
Related Posts :-
- Enable .NET Framework 3.5 in Windows 10 using SCCM
- List SCCM Application Deployments Using PowerShell Script
- Install Azure PowerShell Module in Windows 10
However I did observe some strange thing after changing the client cache size in client settings. Upon checking the Cache tab of configuration manager properties, the settings were greyed out. I could not see the client cache size nor click configure settings. The amount of disk space showed value ‘0’.
PowerShell always comes handy when you want to retrieve data which is not possible from GUI method. On the client machine, run the PowerShell as administrator. In the below screenshot the first command that I used is :-
Get-WmiObject -Namespace ROOT\CCM\SoftMgmtAgent
When you run the above command, it asks for class value. Specify the class as CacheConfig and press enter. You now see it shows data such as location of ccmcache folder, size of cache and computer name. This is one way to know the client cache size.
Get-WmiObject -Namespace ROOT\CCM\SoftMgmtAgent -Query “Select Size from CacheConfig”
When we enter the above command, we see the size of sccm client cache.
The last command is a one line command that shows the size of sccm client cache. Here’s the command used :-
Get-WmiObject -Namespace ROOT\CCM\SoftMgmtAgent -Query “Select Size from CacheConfig” | Select-Object -ExpandProperty “Size”
Get-WmiObject -Namespace ROOT\CCM\SoftMgmtAgent -Query “Select Size from CacheConfig” | Select Size