cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joekos
Engaged Sweeper
I'm new to Lansweeper. Is there a way to do a compound query? I'm looking for all computers with filename.dll and not filename.exe.

1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
Submit your file scans under Configuration/Scanning Setup/Custom Scanning, rescan your machines and run the report below to list computers that meet both requirements.
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where (tblAssets.AssetID In (Select Top 1000000 tblFileVersions.AssetID
From tblFileVersions
Where tblFileVersions.Found = 1 And tblFileVersions.FilePathfull =
'c:\program files\application\filename.dll') And
tblAssets.AssetID Not In (Select Top 1000000 tblFileVersions.AssetID
From tblFileVersions
Where tblFileVersions.Found = 1 And tblFileVersions.FilePathfull =
'c:\program files\application\filename.exe')) And
tblAssets.Lastseen Is Not Null And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName

View solution in original post

4 REPLIES 4
joekos
Engaged Sweeper
thank you that worked perfectly
Hemoco
Lansweeper Alumni
Submit your file scans under Configuration/Scanning Setup/Custom Scanning, rescan your machines and run the report below to list computers that meet both requirements.
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where (tblAssets.AssetID In (Select Top 1000000 tblFileVersions.AssetID
From tblFileVersions
Where tblFileVersions.Found = 1 And tblFileVersions.FilePathfull =
'c:\program files\application\filename.dll') And
tblAssets.AssetID Not In (Select Top 1000000 tblFileVersions.AssetID
From tblFileVersions
Where tblFileVersions.Found = 1 And tblFileVersions.FilePathfull =
'c:\program files\application\filename.exe')) And
tblAssets.Lastseen Is Not Null And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName
joekos
Engaged Sweeper
Yes i know the exact path that both the dll and the exe will be in so i just want to be able to look for all computers with the c:\program files\application\filename.dll and then in those show the ones that don't have the c:\program files\application\filename.exe
Hemoco
Lansweeper Alumni
These kinds of queries are possible, but you cannot search an entire computer for a specific DLL/EXE, if this is what you're trying to do. You can only submit specific file paths and value names for file and registry scanning.