Hello,
I have a sccm 2012 query:
SELECT DISTINCT SMS_R_System.LastLogonUserName,
SMS_G_System_COMPUTER_SYSTEM.Name,
SMS_G_System_PC_BIOS.SerialNumber,
SMS_R_System.SystemOUName,
SMS_G_System_COMPUTER_SYSTEM.Manufacturer,
SMS_G_System_COMPUTER_SYSTEM.Model,
SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,
SMS_G_System_CH_ClientSummary.ADLastLogonTime,
SMS_R_System.SystemGroupName
FROM SMS_R_System
INNER JOIN SMS_G_System_COMPUTER_SYSTEM ON SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId
INNER JOIN SMS_G_System_PC_BIOS ON SMS_G_System_PC_BIOS.ResourceID = SMS_R_System.ResourceId
INNER JOIN SMS_G_System_WORKSTATION_STATUS ON SMS_G_System_WORKSTATION_STATUS.ResourceID = SMS_R_System.ResourceId
INNER JOIN SMS_G_System_CH_ClientSummary ON SMS_G_System_CH_ClientSummary.ResourceID = SMS_R_System.ResourceId;
that I am trying to convert in SQL, for a report, so I may send the web report to a user. Everything works in the report, but I am missing SMS_R_System.SystemOUName. What is the equivalent of SMS_R_System.SystemOUName in SQL? What would the sql report look like?
SQL Report
SELECT DISTINCT SMS_R_System.ItemKey,SMS_R_System.User_Name0,
SMS_G_System_COMPUTER_SYSTEM.Name00,
SMS_G_System_PC_BIOS.SerialNumber00,
SMS_G_System_COMPUTER_SYSTEM.Manufacturer00,
SMS_G_System_COMPUTER_SYSTEM.Model00,
___System_WORKSTATION_STATUS0.LastHWScan,
SMS_G_System_CH_ClientSummary.LastOnline
FROM vSMS_R_System AS SMS_R_System
INNER JOIN Computer_System_DATA AS SMS_G_System_COMPUTER_SYSTEM ON SMS_G_System_COMPUTER_SYSTEM.MachineID = SMS_R_System.ItemKey
INNER JOIN PC_BIOS_DATA AS SMS_G_System_PC_BIOS ON SMS_G_System_PC_BIOS.MachineID = SMS_R_System.ItemKey
INNER JOIN WorkstationStatus_DATA AS ___System_WORKSTATION_STATUS0 ON ___System_WORKSTATION_STATUS0.MachineID = SMS_R_System.ItemKey
INNER JOIN v_CH_ClientSummary AS SMS_G_System_CH_ClientSummary ON SMS_G_System_CH_ClientSummary.ResourceID = SMS_R_System.ItemKey;
Thanks,
Mark