→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tenupmoc
Engaged Sweeper III

Hello,

i need a specific sql query for tblAutorunUNI.command "C:\Program Files\Microsoft OneDrive\OneDrive.exe" /background" , that reports all clients, if the command exists or not exists.

Doing a query for is not like 'C:\Program Files\Microsoft OneDrive\OneDrive.exe' reports all other autorun commands too.

3 REPLIES 3
Mister_Nobody
Honored Sweeper II

Try this

Select Top (1000000) tblAssets.AssetID,
  tblAssets.Domain,
  tblAssets.AssetName,
  tblAutorunUni.Caption,
  tblAutorunUni.Command,
  tblAutorunUni.CreationDate,
  tblAutorun.Lastchanged
From tblAssets
  Inner Join tblAutorun On tblAssets.AssetID = tblAutorun.AssetID
  Inner Join tblAutorunUni On tblAutorun.AutorunUNI = tblAutorunUni.AutorunUNI
Where tblAutorunUni.Command Like '%\OneDrive.exe" /background'
Order By tblAutorun.Lastchanged Desc

Thx,

but this report will only show all assets where the command line exists.

I need a report, that shows all assets where the command line exists or not exists, you know.

All information in one report.

IMHO, it is useless but take SQL:

Select Top 1000000 tblAutorun.assetid,
  tblAssets.assetname,
  tblAutorunUni.Command,
  Count(tblAutorunUni.Command) onedrive_present
From tblAssets
  Inner Join tblAutorun On tblAssets.AssetID = tblAutorun.AssetID
  Left Join tblAutorunUni On tblAutorun.AutorunUNI = tblAutorunUni.AutorunUNI
      And tblAutorunUni.Command Like '%\OneDrive.exe" /background'
Group By tblAutorun.assetid,
  tblAssets.assetname,
  tblAutorunUni.Command

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now