Monday, October 4, 2010

Query to list all the machines with their physical memory capacity

select a.Netbios_name0, a.Creation_date0,a.User_name0,a.client0, a.ad_site_name0,a.obsolete0,b.sms_installed_sites0 as 'sitecode',
os.Caption0 + ' '+ os.CSDversion0 as 'Operating System',mem.Capacity0 as 'Memory in MB',c.Lasthwscan
from v_r_system a
left outer join v_RA_System_SMSInstalledSites b on a.resourceid=b.resourceid
left outer join v_GS_WORKSTATION_STATUS c on a.resourceid=c.resourceid
left outer join v_GS_Operating_system OS on os.resourceid=a.resourceid
left outer Join v_GS_PHYSICAL_MEMORY mem on mem.resourceid=a.resourceid
Order by mem.Capacity0 desc

2 Comments:

Blogger itsallaboutme-and-myworld said...

Cannot find v_GS_PHYSICAL_MEMORY

Could you re-verify this

April 28, 2011 at 5:08 AM  
Blogger Jaison Jose said...

You have to edit your MOF file to add this custom class of Physical Memory (sorry for not mentioning that in my post)..

Add this section in your MOF file...

// <:[-<>>>>>>>>>>>>>>>>>>>>>>>>>>-Physical Memory-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>-]:>

//Base class exists. Just need reporting class that matches the name

//`'`*._.*`'`*-
// Physical Memory Reporting Class
//`'`*._.*`'`*-

#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("Win32_PhysicalMemory", NOFAIL)

[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(FALSE)] string Caption;
[SMS_Report(FALSE)] string CreationClassName;
[SMS_Report(TRUE)] uint16 DataWidth;
[SMS_Report(FALSE)] string Description;
[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)] uint16 TypeDetail;
};

If you can't edit MOF, then use v_GS_X86_PC_MEMORY view for memory details.

April 28, 2011 at 5:13 AM  

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home