Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

SOLVED SCCM SQL Custom Query

Status
Not open for further replies.
select computer_system_data.name00, computer_system_data.username00, SoftwareFile.filename, SoftwareFile.FileVersion, softwarefilepath.filepath
FROM computer_system_data, SoftwareFile, softwareinventory, workstationstatus_data, softwarefilepath
WHERE computer_system_data.machineId = softwareinventory.clientid
and softwareinventory.fileid = softwarefile.fileid
and softwareinventory.filepathid = softwarefilepath.filepathid
and SoftwareFile.filename = 'SoD.exe'
 
It is not supported to query the tables directly, always use the SQL view. Also ensure that you do you joins correctly.

SQL:
select
    RV.Netbios_Name0,
    RV.User_Name0,
    SF.filename,
    SF.FileVersion,
    SF.FilePath
FROM
    dbo.v_R_System_Valid RV
    inner join dbo.v_GS_SoftwareFile SF on RV.ResourceID = SF.ResourceID
WHERE
    SF.FileName = 'SoD.exe'
 
Status
Not open for further replies.
Back
Top