Jeff Gilbert's Web blog at myITforum.com

This posting is provided "AS IS" with no warranties, and confers no rights :-)
How to query physical memory chips using SMS hardware inventory

The question about how to inventory physical RAM chips installed on SMS clients seems to come up a lot. I've created this blog post to create a centralized location for the answer to this question. Anyway, the MOF edit I use for this is below. If you modify this extension be sure to take note of the compound key (Tag and CreationClassName) and array designator [] for DeviceLocator--leave those in the edit or you will have issues...trust me. The SMS_Units property I added is just to make the information more 'human friendly' when displayed in Resource Explorer.

 

[SMS_Report (TRUE),
SMS_Group_Name ("Physical Memory"),
SMS_Class_ID   ("Microsoft|Physical_Memory|1.0")]

class Win32_PhysicalMemory : SMS_Class_Template
{   
                [SMS_Report (TRUE)] string BankLabel;   
                [SMS_Report (TRUE), SMS_Units("Megabytes")]  uint64 Capacity;   
                [SMS_Report (TRUE)] string Caption;   
                [SMS_Report (TRUE)] string DeviceLocator[];   
                [SMS_Report (TRUE)] uint16 FormFactor;   
                [SMS_Report (TRUE)] string Manufacturer;   
                [SMS_Report (TRUE)] uint16 MemoryType;   
                [SMS_Report (TRUE)] uint32 PositionInRow;   
                [SMS_Report (TRUE)] uint32 Speed;   
                [SMS_Report (TRUE),Key] string    Tag;   
                [SMS_Report (TRUE),Key] string    CreationClassName;
};

 

Hope this helps,

 

~Jeff

Published Wednesday, May 30, 2007 6:07 PM by jgilbert

Comments

# re: How to query physical memory chips using SMS hardware inventory@ Friday, August 24, 2007 3:04 PM

Hi Jeff.  When implementing this edit; 1 company noticed that changes were not being correctly reflected unless they had the pragma deleteclass.

#pragma namespace("\\\\.\\ROOT\\CIMV2\\SMS")

#pragma deleteclass("win32_PhysicalMemory",NOFAIL)

skissinger

# re: How to query physical memory chips using SMS hardware inventory@ Saturday, August 25, 2007 12:23 PM

That most likely means that the class was already there from an earlier attempt. You should only need the #pragma deleteclass line if you've changed something in the edit and need to totally re-create it.

jgilbert

# re: How to query physical memory chips using SMS hardware inventory@ Thursday, July 10, 2008 10:10 AM

Jeff,

Thanks for this: it was just what I was looking for.

One question.  Is there a way that I can get this information into a report?

Andy

Pocket

# re: How to query physical memory chips using SMS hardware inventory@ Friday, July 11, 2008 2:23 PM

Here you go, just save this as a .mof and import it into your reports. Watch for word wrap here and make sure all the comments start with //. I've picked a couple values more or less from random that look good to me for this report. More information about the values returned can be found on MSDN for this class--I've put the link in the report comments.

// *********************************************************************************

//

// Created by SMS Export object wizard

//

// Friday, June 27, 2008 created

//

// File Name: PhysicalMemoryReport.mof

//

// Comments :

//

// For more information about the Win32_PhysicalMemory class and what all the returned values // mean, see: msdn.microsoft.com/.../aa394347(VS.85).aspx

//

// *********************************************************************************

// ***** Class : SMS_Report *****

[SecurityVerbs(140551)]

instance of SMS_Report

{

Category = "Hardware - Memory";

Comment = "";

GraphCaption = "";

GraphXCol = 1;

GraphYCol = 2;

MachineDetail = FALSE;

MachineSource = FALSE;

Name = "Physical Memory Report";

NumPrompts = 0;

RefreshInterval = 0;

ReportGUID = "{CF3452E2-A554-45AC-BFF5-CC1F8566A5FF}";

SecurityKey = "";

SQLQuery = "SELECT BankLabel0, Capacity0, DeviceLocator0, FormFactor0, MemoryType0, PositionInRow0 FROM v_GS_PHYSICAL_MEMORY";

StatusMessageDetailSource = FALSE;

UnicodeData = FALSE;

XColLabel = "";

YColLabel = "";

};

// ***** End *****

jgilbert

# re: How to query physical memory chips using SMS hardware inventory@ Tuesday, July 15, 2008 7:31 AM

Jeff,

That's absolutely fantastic.  I had to edit a couple of lines to get the MOF file to import(specifically removing the ReportGUID and UnicodeData lines) but after that, it worked perfectly.

Really appreciate you taking the time to get back to me.

Andy

Pocket

# re: How to query physical memory chips using SMS hardware inventory@ Wednesday, July 16, 2008 11:14 PM

Glad it worked for you Andy!

jgilbert