
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 08:43 PM
I found the below script in the forum:
https://www.lansweeper.com/forum/yaf_postst17753findunread_check-if-process-is-running-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!
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.com/forum/yaf_postst17753findunread_check-if-process-is-running-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!
Labels:
- Labels:
-
Report Center
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 10:38 PM
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:
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".
Try this instead:
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".
