Notification

Icon
Error

Change processes report to show opposite results - Trying to get all PCs w/o this running process

Posted: Monday, June 29, 2020 7:43:28 PM(UTC)
William382

William382

Member Original PosterPosts: 27
0
Like
I found the below script in the forum:
Quote:
Select Top 1000 tblAssets.AssetName,
tblProcesses.Caption
From tblAssets
Inner Join tblProcesses On tblAssets.AssetID = tblProcesses.AssetID
Where tblProcesses.Caption = 'OneDrive.exe'


https://www.lansweeper.c...ng-report.aspx#post59508

I want to change it to where I can see any PCs NOT running OneDrive. I'm trying to get certainty this process is running org wide and ensure it sends a weekly email if we have some down. You know, for syncing stuff.

I tried modifying the last line with a NOT, but that didn't work. How can I make this show only PC without this process.
Where NOT tblProcesses.Caption = 'OneDrive.exe'
I could do a compare column in excel with what the output is of the above, but I'd like to all canned up nicely in a report.

Thank you!
RC62N
#1RC62N Member Posts: 450  
posted: 6/29/2020 9:38:46 PM(UTC)
You've run into a "do what I mean, not what I say" situation. By NOT-ing your WHERE condition, you're basically saying "show me everything except OneDrive.exe".

Try this instead:
Code:
Select Top 1000
  tblAssets.AssetName
From
  tblAssets
Where
   NOT EXISTS (SELECT tblProcesses.AssetID
               FROM tblProcesses
               WHERE tblProcesses.Caption = 'OneDrive.exe'
                 AND tblProcesses.AssetID = tblAssets.AssetID)

If you remove the NOT on this, it should return the same asset list as your original query.

In this case, the sub-SELECT is pulling a list of assets that include the OneDrive.exe process, then the main SELECT is saying "show me a list of assets that aren't in that list".

Active Discussions

Lansweeper Help Desk Workflow
by  lswanson   Go to last post Go to first unread
Last post: Yesterday at 11:12:21 PM(UTC)
Lansweeper Changing to remote scanning due to COVID
by  FrankSc  
Go to last post Go to first unread
Last post: Yesterday at 9:35:26 PM(UTC)
Lansweeper Not giving hackers the Domain Admin password / account
by  FrankSc   Go to last post Go to first unread
Last post: Yesterday at 9:27:13 PM(UTC)
Lansweeper LsAgent failing - Lansweeper SSL Expired
by  lansweeper25t34  
Go to last post Go to first unread
Last post: Yesterday at 8:33:28 PM(UTC)
Lansweeper Is there a chance to get the firewall off via Lansweeper?
by  EDV_OHZ   Go to last post Go to first unread
Last post: Yesterday at 4:57:26 PM(UTC)
Lansweeper Merge Asset button
by  KeithBecker  
Go to last post Go to first unread
Last post: 8/5/2020 9:27:54 PM(UTC)
Lansweeper Merge Two Assets or Update Based on Serial Number
by  KeithBecker   Go to last post Go to first unread
Last post: 8/5/2020 9:25:16 PM(UTC)
Lansweeper Hyper-V guest assets
by  bgstein  
Go to last post Go to first unread
Last post: 8/5/2020 5:50:24 PM(UTC)