Notification

Icon
Error

Report on 2 custom scanned files

Posted: Tuesday, February 11, 2020 10:06:11 PM(UTC)
jwood.mls

jwood.mls

Member Original PosterPosts: 50
0
Like
This issue has been solved! Click here to view the solution
I have a report based on a custom scanned files. Based on those items, I've done a deployment of another file which I am now scanning. What I'd like to do is a report of items that have file #1 but NOT file #2 so that I can make sure that everything has gotten the deployed files.
RC62N
#1RC62N Member Posts: 444  
posted: 2/11/2020 10:29:57 PM(UTC)
See this thread. You should be able to use the same approach.
jwood.mls
#2jwood.mls Member Original PosterPosts: 50  
posted: 2/11/2020 10:36:58 PM(UTC)
Originally Posted by: RC62N Go to Quoted Post
See this thread. You should be able to use the same approach.


Is that going to be different with a custom scanned item versus installed software, though? In other words, would it be listed in tblSoftware?


RC62N
#3RC62N Member Posts: 444  
posted: 2/11/2020 11:09:26 PM(UTC)
You'll need to change the sub-selects to query against tblFileVersions instead of tblSoftware. The approach is the same: create a query to check whether file X has been scanned for and/or found; create a second query to check whether file Y has been scanned for and/or found. Those are your sub-selects. Link the main select of your assets against those two.

e.g.
Code:
Select Top 1000000
  tblAssets.AssetID,
  tblAssets.AssetName,
  tsysAssetTypes.AssetTypename,
  tsysAssetTypes.AssetTypeIcon10 As icon,
  tblAssets.IPAddress,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  softwareX.FileStatus AS X_status,
  softwareX.FilePathfull AS X_name,
  softwareX.FileVersion AS X_version,
  softwareY.FileStatus AS Y_status,
  softwareY.FilePathfull AS Y_name,
  softwareY.FileVersion AS Y_version
From
  tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tblComputerSystem On tblComputerSystem.AssetID = tblAssets.AssetID
  Left Join (SELECT
               tblFileVersions.AssetID,
               Case tblFileVersions.Found
                 When 0 Then 'Absent'
                 When 1 Then 'Present'
                 Else '(not checked)'
               END AS FileStatus,
               tblFileVersions.FilePathfull,
               tblFileVersions.FileVersion,
               tblFileVersions.CompanyName
             FROM
               tblFileVersions
             WHERE
               tblFileVersions.FilePathfull Like '%file_1%') AS softwareX On softwareX.AssetID = tblAssets.AssetID
  Left Join (SELECT
               tblFileVersions.AssetID,
               Case tblFileVersions.Found
                 When 0 Then 'Absent'
                 When 1 Then 'Present'
                 Else '(not checked)'
               END AS FileStatus,
               tblFileVersions.FilePathfull,
               tblFileVersions.FileVersion,
               tblFileVersions.CompanyName
             FROM
               tblFileVersions
             WHERE
               tblFileVersions.FilePathfull Like '%file_2%') AS softwareY On softwareY.AssetID = tblAssets.AssetID
Where
  tblAssetCustom.State = 1                -- active
  AND tblAssets.AssetType = -1            -- Windows machines
  AND tblComputerSystem.Domainrole <= 1   -- workstations
  AND softwareX.FileStatus IN ('Present', '(not checked)')       -- file 1 found or not yet checked for
  AND (softwareY.AssetID IS NULL
       OR SoftwareY.FileStatus IN ('Absent', '(not checked)') )  -- file 2 not found or not yet checked for
jwood.mls
#4jwood.mls Member Original PosterPosts: 50  
posted: 2/12/2020 1:35:14 AM(UTC)
Thank you - that is exactly what I was needing. I appreciate it!

Active Discussions

Lansweeper Remote desktop custom port
by  sefaucher   Go to last post Go to first unread
Last post: Yesterday at 10:30:49 PM(UTC)
Lansweeper Unable to transfer user's data prior to removal
by  RickW99456  
Go to last post Go to first unread
Last post: Yesterday at 9:06:14 PM(UTC)
Lansweeper Unable to access the lansweeper consol for other computer
by  Kudnan Ingle   Go to last post Go to first unread
Last post: Yesterday at 7:49:32 PM(UTC)
Lansweeper Closing and re-opening of tickets
by  NWHiker  
Go to last post Go to first unread
Last post: Yesterday at 3:42:56 PM(UTC)
Lansweeper Wake on Lan Issues
by  woldummy   Go to last post Go to first unread
Last post: Yesterday at 3:42:07 PM(UTC)
Lansweeper Deploy and start Software
by  EDV_OHZ  
Go to last post Go to first unread
Last post: Yesterday at 12:49:08 PM(UTC)
Lansweeper Helpdek Call Re-Opened
by  mouaad   Go to last post Go to first unread
Last post: Yesterday at 7:30:59 AM(UTC)
Lansweeper macOS lsAgent 100% CPU Usage
by  McDeth187  
Go to last post Go to first unread
Last post: Yesterday at 2:30:33 AM(UTC)