Monday, 8 September 2014

Hardware Inventory V2





This is a different hardware inventory report:


Select

SD.Name0 'Machine Name',
SD.User_Name0,
SD.AD_Site_Name0,
OU.System_OU_Name0,
CS.Manufacturer0 Manufacturer,
CS.Model0 Model,
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

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!