counter hit make
How to retrieve the Lenovo Modelname (Full name) instead of TypeNumber within Configmgr - sccm

SCCM - System Center Configuration Manager

Blog about SCCM 2007 aka SMS v4

Recent Posts

Tags

News

Community

Email Notifications

    Blogs

    Archives

    How to retrieve the Lenovo Modelname (Full name) instead of TypeNumber within Configmgr

    A customer of mine wanted a readable report on the different machine that existed in his country.

    Right now it apears as the typenumber , witch frankly a manager does not care about and I can totally understand it.

    You will see what I mean . This is what you get if you use the default report :

    image

    This is what management wants to see :

    image

    To get to this result , please follow the guidelines below :

    Now to tried and  find out where it was stored  , we used wmiexplorer . We show you where to find it below :

    wmi

     

    Lenovo's store their “ModelName” in a different WMI class that others (Win32_ComputerSystemProduct as opposed to Win32_ComputerSystem ).  By default that class is not enabled in the SMS_DEF.MOF file.

    Go to your SMS_DEF.MOF file and enable it as followed

       1: [ SMS_Report     (TRUE), 
       2:   SMS_Group_Name ("Computer System Product"), 
       3:   SMS_Class_ID   ("MICROSOFT|COMPUTER_SYSTEM_PRODUCT|1.0") ] 
       4:  
       5: class Win32_ComputerSystemProduct : SMS_Class_Template 
       6: { 
       7:     [SMS_Report (TRUE)     ] 
       8:         string     Caption; 
       9:     [SMS_Report (TRUE)     ] 
      10:         string     Description; 
      11:     [SMS_Report (TRUE), key] 
      12:         string     IdentifyingNumber; 
      13:     [SMS_Report (TRUE), key] 
      14:         string     Name; 
      15:     [SMS_Report (TRUE)     ] 
      16:         string     SKUNumber; 
      17:     [SMS_Report (TRUE)     ] 
      18:         string     UUID; 
      19:     [SMS_Report (TRUE)     ] 
      20:         string     Vendor; 
      21:     [SMS_Report (TRUE), key] 
      22:         string     Version; 
      23: }; 

     

    Now that the HW inventory is modified , we still need to update our reporting .Below you will find the code for the report :

    Here's the fun part... win32_computersystemproduct is somehow hard coded into inventory to be resolved into v_gs_client0 , so go look there for the results (once you've made the changes)  . Thanks Sherry Kissinger for the tip !!!

       1: select  distinct 
       2:  v_R_System_Valid.ResourceID, 
       3:  v_R_System_Valid.Netbios_Name0 AS [Computer Name], 
       4:  v_R_System_Valid.Resource_Domain_OR_Workgr0 AS [Domain/Workgroup], 
       5:  [Top Console User] = CASE 
       6:  when (v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 is NULL or v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 = '-1') 
       7:  then 'Unknown' 
       8:  Else v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 
       9:  End, 
      10:  v_GS_OPERATING_SYSTEM.Caption0 AS [Operating System], 
      11:  v_GS_OPERATING_SYSTEM.CSDVersion0 AS [Service Pack Level], 
      12:  v_GS_SYSTEM_ENCLOSURE_UNIQUE.SerialNumber0 AS [Serial Number], 
      13:  v_GS_SYSTEM_ENCLOSURE_UNIQUE.SMBIOSAssetTag0 AS [Asset Tag], 
      14:  v_GS_COMPUTER_SYSTEM.Manufacturer0 AS [Manufacturer], 
      15:  v_GS_COMPUTER_SYSTEM.Model0 AS [Model], 
      16:  v_GS_Client0.Version0 AS [ModelName], 
      17:  v_GS_X86_PC_MEMORY.TotalPhysicalMemory0 AS [Memory (KBytes)], 
      18:  v_GS_PROCESSOR.NormSpeed0 AS [Processor (GHz)], 
      19:  (Select sum(Size0) 
      20:  from v_GS_LOGICAL_DISK inner join v_FullCollectionMembership on (v_FullCollectionMembership.ResourceID = v_GS_LOGICAL_DISK.ResourceID ) 
      21:   where v_GS_LOGICAL_DISK.ResourceID =v_R_System_Valid.ResourceID and 
      22:   v_FullCollectionMembership.CollectionID = @CollectionID) As [Disk Space (MB)], 
      23:  (Select sum(v_GS_LOGICAL_DISK.FreeSpace0) 
      24:  from v_GS_LOGICAL_DISK inner join v_FullCollectionMembership on (v_FullCollectionMembership.ResourceID = v_GS_LOGICAL_DISK.ResourceID ) 
      25:  where v_GS_LOGICAL_DISK.ResourceID =v_R_System_Valid.ResourceID and v_FullCollectionMembership.CollectionID = @CollectionID) As [Free Disk Space (MB)] 
      26:  from v_R_System_Valid 
      27:  inner join v_GS_OPERATING_SYSTEM on (v_GS_OPERATING_SYSTEM.ResourceID = v_R_System_Valid.ResourceID) 
      28:  left join v_GS_SYSTEM_ENCLOSURE_UNIQUE on (v_GS_SYSTEM_ENCLOSURE_UNIQUE.ResourceID = v_R_System_Valid.ResourceID) 
      29:  inner join v_GS_COMPUTER_SYSTEM on (v_GS_COMPUTER_SYSTEM.ResourceID = v_R_System_Valid.ResourceID) 
      30:  inner join v_GS_Client0 on 
      31: ( v_GS_Client0.ResourceID = v_R_System_Valid.ResourceID) 
      32:  inner join v_GS_X86_PC_MEMORY on (v_GS_X86_PC_MEMORY.ResourceID = v_R_System_Valid.ResourceID) 
      33:  inner join v_GS_PROCESSOR on (v_GS_PROCESSOR.ResourceID = v_R_System_Valid.ResourceID) 
      34:  inner join v_FullCollectionMembership on (v_FullCollectionMembership.ResourceID = v_R_System_Valid.ResourceID) 
      35:  left  join v_Site on (v_FullCollectionMembership.SiteCode = v_Site.SiteCode) 
      36:  inner join v_GS_LOGICAL_DISK on (v_GS_LOGICAL_DISK.ResourceID = v_R_System_Valid.ResourceID) and v_GS_LOGICAL_DISK.DeviceID0=SUBSTRING(v_GS_OPERATING_SYSTEM.WindowsDirectory0,1,2) 
      37:  left join v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP on (v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.ResourceID = v_R_System_Valid.ResourceID) 
      38:  Where v_FullCollectionMembership.CollectionID = @CollectionID 
      39:  Order by v_R_System_Valid.Netbios_Name0 

     

    Hope it Helps ,

    Kenny Buntinx

    Comments

    Stellair said:

    Really helpful! Thanks

    # December 9, 2010 12:43 PM