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: 25
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: 440  
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 Lost Configuration tab (Admin rights)
by  kspap   Go to last post Go to first unread
Last post: Today at 10:30:12 AM(UTC)
Lansweeper Deployment with different user rights
by  Jupiter_IT  
Go to last post Go to first unread
Last post: Today at 9:39:20 AM(UTC)
Lansweeper cisco fuji device not linking with connected devices
by  char   Go to last post Go to first unread
Last post: Yesterday at 9:12:07 AM(UTC)
Lansweeper Microsoft CVE-2020-1425
by  Richard_B  
Go to last post Go to first unread
Last post: 7/3/2020 4:29:41 PM(UTC)
Lansweeper Software audit with installation date
by  RC62N   Go to last post Go to first unread
Last post: 7/3/2020 3:39:41 PM(UTC)
Lansweeper Wake on Lan in VLANs
by  FrankSc  
Go to last post Go to first unread
Last post: 7/3/2020 1:56:46 PM(UTC)
Lansweeper Ticket Closed = email to all helpdesk desk agents
by  Laurent Maene   Go to last post Go to first unread
Last post: 7/3/2020 1:23:49 PM(UTC)
Lansweeper Helpdek Call Re-Opened
by  pryan67  
Go to last post Go to first unread
Last post: 7/3/2020 1:12:17 PM(UTC)