Answered by:
Need a SCCM query to a special cache size

Question
-
Hello together,
I need a query that gives me all clients that have a SCCM-Cache-Size less than 5000MB.
I want to create a collection where all this clients are in and automatically get out again if they have 5000MB (I run a script on all clients in our company).
Does anybody have one or can help me?
Greetings from Germany
TP_FI_Ger
Thursday, September 6, 2012 3:11 PM
Answers
-
The cache size is not collected by default, you need to extend the hardware inventory to be enable to make a query of the cache size, so you need to start with that.
Add the follwing to your sms_def.mof:
//========================
//`'`*._.*`'`*-
// SMS Advanced Client Cache Reporting Class
//`'`*._.*`'`*-
//
#pragma namespace ("\\\\.\\root\\cimv2\\sms")[ SMS_Report (TRUE), SMS_Group_Name ("SMS Advanced Client Cache"),
Namespace ("root\\\\ccm\\\\softmgmtagent"),
SMS_Class_ID ("MICROSOFT|SMS_ADVANCED_CLIENT_CACHE|1.0") ]class CacheConfig : SMS_Class_Template
{
[SMS_Report (TRUE),key ] string ConfigKey;
[SMS_Report (TRUE)] boolean InUse;
[SMS_Report (TRUE)] string Location;
[SMS_Report (TRUE)] uint32 Size;
};Then when the clients starts collection the cache info.
- Proposed as answer by Sherry Kissinger Thursday, September 6, 2012 4:08 PM
- Unproposed as answer by Sherry Kissinger Thursday, September 6, 2012 4:09 PM
- Proposed as answer by Sherry Kissinger Thursday, September 6, 2012 4:11 PM
- Marked as answer by Robert Marshall - MVPMVP Monday, September 10, 2012 11:58 AM
Thursday, September 6, 2012 3:37 PM
All replies
-
The cache size is not collected by default, you need to extend the hardware inventory to be enable to make a query of the cache size, so you need to start with that.
Add the follwing to your sms_def.mof:
//========================
//`'`*._.*`'`*-
// SMS Advanced Client Cache Reporting Class
//`'`*._.*`'`*-
//
#pragma namespace ("\\\\.\\root\\cimv2\\sms")[ SMS_Report (TRUE), SMS_Group_Name ("SMS Advanced Client Cache"),
Namespace ("root\\\\ccm\\\\softmgmtagent"),
SMS_Class_ID ("MICROSOFT|SMS_ADVANCED_CLIENT_CACHE|1.0") ]class CacheConfig : SMS_Class_Template
{
[SMS_Report (TRUE),key ] string ConfigKey;
[SMS_Report (TRUE)] boolean InUse;
[SMS_Report (TRUE)] string Location;
[SMS_Report (TRUE)] uint32 Size;
};Then when the clients starts collection the cache info.
- Proposed as answer by Sherry Kissinger Thursday, September 6, 2012 4:08 PM
- Unproposed as answer by Sherry Kissinger Thursday, September 6, 2012 4:09 PM
- Proposed as answer by Sherry Kissinger Thursday, September 6, 2012 4:11 PM
- Marked as answer by Robert Marshall - MVPMVP Monday, September 10, 2012 11:58 AM
Thursday, September 6, 2012 3:37 PM -
And then when the clients have started the inventory you could make a collection with a query like this:
select * from SMS_R_System inner join SMS_G_System_SMS_ADVANCED_CLIENT_CACHE on SMS_G_System_SMS_ADVANCED_CLIENT_CACHE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SMS_ADVANCED_CLIENT_CACHE.Size < 5120
- Proposed as answer by Quan xu Friday, September 7, 2012 6:53 AM
Thursday, September 6, 2012 5:03 PM -
Thank you for the fast help!
I will try this!
Friday, September 7, 2012 5:58 AM -
Could you please also share the equivalent SQL query which I can use in SQL Report for this ?Wednesday, February 3, 2016 5:11 AM
-
select Name0,Client_Version0,Operating_System_Name_and0,v_GS_ADV_CLIENT_CACHE.Size0 from V_R_System
join v_GS_ADV_CLIENT_CACHE on v_GS_ADV_CLIENT_CACHE.ResourceId = V_R_System.ResourceId where
Client0 =1Monday, March 2, 2020 10:55 AM -
select Name0,Client_Version0,Operating_System_Name_and0,v_GS_ADV_CLIENT_CACHE.Size0 from V_R_System
join v_GS_ADV_CLIENT_CACHE on v_GS_ADV_CLIENT_CACHE.ResourceId = V_R_System.ResourceId where
Client0 =1Monday, March 2, 2020 10:56 AM