Link to home
Start Free TrialLog in
Avatar of rdefino
rdefinoFlag for United States of America

asked on

How to pull a hardware report with SCCM 2012

I have sccm 2012 in my environment and I have the cm client deployed to about 6500 systems.

How can I pull a report on the system, like make, model, specs, software?

thanks
Avatar of Leo
Leo
Flag of Australia image

Save this code as a .mof and import it into reports.

// *********************************************************************************
//
//  Created by SMS Export object wizard
//
//  
//  File Name: all-in-one.mof
//
// Comments :
//
//
// *********************************************************************************


// ***** Class : SMS_Report *****
[SecurityVerbs(140551)]
instance of SMS_Report
{
 Category = "Department Reports";
 Comment = "";
 GraphCaption = "";
 GraphXCol = 1;
 GraphYCol = 2;
 MachineDetail = FALSE;
 MachineSource = FALSE;
 Name = "All-In-One Machine Details";
 NumPrompts = 1;
 RefreshInterval = 0;
 ReportGUID = "{435A5365-5EE2-4C85-BC2F-6A894E7A682B}";
 
 ReportParams = {
instance of SMS_ReportParameter
{
 AllowEmpty = FALSE;
 DefaultValue = "";
 PromptText = "Enter Machine Name";
 SampleValueSQL = "select Name0 from v_R_System order by Name0";
 VariableName = "MachineName";
}};
 SecurityKey = "";
 SQLQuery = "select v_R_System.Name0, v_R_System.Resource_Domain_OR_Workgr0, v_R_System.User_Name0 as Username, v_R_User.Full_User_Name0, v_R_System.AD_Site_Name0 from v_R_System, v_R_User where v_R_System.Name0 like @MachineName and v_R_System.User_Name0 = v_R_User.User_Name0 and v_R_System.User_Domain0 = v_R_User.Windows_NT_Domain0
\n
\nselect v_GS_COMPUTER_SYSTEM.Manufacturer0, v_GS_COMPUTER_SYSTEM.Model0, v_GS_SYSTEM_ENCLOSURE.SerialNumber0 from v_R_System, v_GS_SYSTEM_ENCLOSURE, v_GS_COMPUTER_SYSTEM where v_R_System.Name0 like @MachineName and  v_R_System.ResourceID = v_GS_SYSTEM_ENCLOSURE.ResourceID and v_R_System.ResourceID = v_GS_COMPUTER_SYSTEM.ResourceID
\n
\nselect v_R_System.Operating_System_Name_and0 as OperatingSystem, v_GS_OPERATING_SYSTEM.CSDVersion0 as ServicePack, v_GS_X86_PC_MEMORY.TotalPhysicalMemory0 as Memory from v_R_System, v_GS_X86_PC_MEMORY, v_GS_OPERATING_SYSTEM where v_R_System.Name0 like @MachineName and  v_R_System.ResourceID = v_GS_X86_PC_MEMORY.ResourceID and  v_R_System.ResourceID = v_GS_OPERATING_SYSTEM.ResourceID
\n
\nselect v_GS_LOGICAL_DISK.Name0 as Drive, v_GS_LOGICAL_DISK.Size0 as Size, v_GS_LOGICAL_DISK.FreeSpace0 as FreeSpace from v_R_System, v_GS_LOGICAL_DISK where v_R_System.Name0 like @MachineName and v_GS_LOGICAL_DISK.DriveType0 = 3 and  v_R_System.ResourceID = v_GS_LOGICAL_DISK.ResourceID order by v_GS_LOGICAL_DISK.Name0
\n
\nSelect v_GS_PROCESSOR.MaxClockSpeed0, v_GS_PROCESSOR.Name0,v_GS_PROCESSOR.Manufacturer0 from v_r_system, V_gs_processor where v_R_System.Name0 like @MachineName and v_R_System.ResourceID = v_GS_processor.ResourceID
\n
\nselect v_GS_ADD_REMOVE_PROGRAMS.Publisher0, v_GS_ADD_REMOVE_PROGRAMS.DisplayName0, v_GS_ADD_REMOVE_PROGRAMS.Version0 from v_R_System, v_GS_ADD_REMOVE_PROGRAMS where v_R_System.Name0 like @MachineName and  v_R_System.ResourceID = v_GS_ADD_REMOVE_PROGRAMS.ResourceID order by v_GS_ADD_REMOVE_PROGRAMS.DisplayName0";
 StatusMessageDetailSource = FALSE;
 UnicodeData = FALSE;
 XColLabel = "";
 YColLabel = "";
};
// ***** End *****
Avatar of rdefino

ASKER

How do I access the report on sccm?
Avatar of rdefino

ASKER

I found the reports, and the dummies for reports. :)

But, how do I import the file?
Avatar of rdefino

ASKER

I saved the code to a mof using notepad+ but the import tells me "it could not be compiled".

Did I save it correctly?
try to run some small reports before running this, so you get an idea on how reports are run......
Avatar of rdefino

ASKER

I;m able to run reports, but I cannot import this report. Invalid code error.

thanks for the help
whats the error?can you attach a screenshot.....
Avatar of rdefino

ASKER

Here it is.
Capture.PNG
ASKER CERTIFIED SOLUTION
Avatar of Leo
Leo
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rdefino

ASKER

Still working on it. Thanks for the link