If folder exists query

Hi everyone!

I'm trying to make a query based on if folder exists on computers... Basically all I want is to do is SCCM console to find me computers which have C:\oracle\product\[version]. We have 2 different versions of oracle which are used, 10 and 11. They are placed differently depending which version is installed, e.g. C:\Oracle\product\11.2.0 OR C:\Oracle\product\10.2.0. I wouldn't mind even if I had to do 2 different queries for both versions, as long as I'm still getting those results.

I tried making query with (simple value) software files - file path & (operator) is equal to and value for C:\Oracle\product\11.2.0. Here's query language:

select *  from  SMS_R_System inner join SMS_G_System_CollectedFile on SMS_G_System_CollectedFile.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_INSTALLED_EXECUTABLE on SMS_G_System_INSTALLED_EXECUTABLE.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FilePath = "C:\\Oracle\\product\\11.2.0"

Nada. Tried playing around with different attribute classes and attributes, still nada. Query runs, but doens't get any results. Am I using totally wrong attribute class or method or what? I can make other queries which run and gets results back so requirements for queries should be OK in server and clients end. In theory it shouldn't be that hard to make a query in sccm to find out if computer have a specific folder... or is it?

Oh and ps. software inventory is enabled, inventory reporting detail is full details, file types - and collect files -. Should this also be configured in some way?

I would love if someone could point me to right direction!

May 18th, 2015 10:22am

software inventory collects files, not folders.  I am not sure you can query FILEpath for a folder.

I would use a configuration item and a baseline to create a collection of "compliant" devices IE, those that have the folder.

Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 10:25am

software inventory collects files, not folders.  I am not sure you can query FILEpath for a folder.

I would use a configuration item and a baseline to create a collection of "compliant" devices IE, those that have the folder.

May 18th, 2015 10:25am

software inventory collects files, not folders.  I am not sure you can query FILEpath for a folder.

I would use a configuration item and a baseline to create a collection of "compliant" devices IE, those that have the folder.

Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 2:23pm

Hi

I don't quite understand what you mean by "I would use a configuration item and a baseline to create a collection of "compliant" devices IE, those that have the folder."

Do you mean I should instead search for some file which is in c:\oracle\product\11.2.0?

May 19th, 2015 1:34am

Isn't that information also stored in add/remove programs? 

mrasmussen is talking about creating a configuration baseline  and configuration item that checks for the existence of that folder(s).

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 2:02am

Hmm, good point! I've been focusing to find out query which looks for specific folder / file, what you (or mrasmussen) suggested seems more rational solution. It looks like oracle v. 10 creates 'Oracle Data Provider for .NET Help' file into add or remove programs.... so I should do a query for that file.
May 19th, 2015 2:23am

Small update: I managed to get query working for oracle 10. Oracle 11 on other hand is a bit more complex, it doesn't create any programs / applications to which query, so I'm going for registry. Let's see how that works...
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 3:36am

Finally I managed to get query working! It's not pretty, but it does its job. Query now shows file and full path names, so:

C:\oracle\product\10.2.0\client_1\network\
C:\oracle\product\11.2.0\client_1\network\

tells me which version is which. If this were the first solution I wouldn't even done others because this 1 query gets me all answers. Anyway thanks for help everybody!

May 19th, 2015 4:26am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics