Monday, 8 September 2014

Hardware Inventory

This is a very useful SMS report for beginners:

it's a hardware inventory report completed by Machine name user name, and OU name:

Select distinct

SD.Name0 'Machine Name',
SD.User_Name0,
SD.AD_Site_Name0,
OU.System_OU_Name0,
CS.Manufacturer0 Manufacturer,
CS.Model0 Model,
PR.Name0 'CPU',
ME.TotalPhysicalMemory0 AS [Memory (KBytes],
SN.SerialNumber0 'Serial Number',
OS.Caption0 + Space(1) + OS.CsdVersion0 'Operating System'

From v_R_System SD

Join v_GS_COMPUTER_SYSTEM CS On SD.ResourceID = CS.ResourceID

Join v_GS_SYSTEM_ENCLOSURE SE On SD.ResourceID = SE.ResourceID

Join v_GS_PC_BIOS SN ON SD.ResourceID = SN.ResourceID

Join v_GS_OPERATING_SYSTEM OS On SD.ResourceID = OS.ResourceID

Join v_GS_PROCESSOR PR ON SD.ResourceID = PR.ResourceID

Join v_GS_X86_PC_MEMORY ME ON SD.ResourceID = ME.ResourceID

INNER JOIN (SELECT ResourceID, MAX(System_OU_Name0) AS System_OU_Name0 FROM dbo.v_RA_System_SystemOUName GROUP BY ResourceID) AS ou ON ou.ResourceID = SD.ResourceID

 Where SD.Client0 = 1


0 commenti:

Post a Comment

Give me you feedback!