none
If folder exists query RRS feed

  • Question

  • 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!

    Monday, May 18, 2015 2:20 PM

Answers

  • 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!

    Tuesday, May 19, 2015 8:25 AM

All replies

  • 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.

    Monday, May 18, 2015 2:23 PM
  • 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?

    Tuesday, May 19, 2015 5:32 AM
  • 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).


    Torsten Meringer | http://www.mssccmfaq.de

    Tuesday, May 19, 2015 6:00 AM
    Moderator
  • 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.
    Tuesday, May 19, 2015 6:21 AM
  • 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...
    Tuesday, May 19, 2015 7:34 AM
  • 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!

    Tuesday, May 19, 2015 8:25 AM
  • Thanks - But it would have been a bit more useful to others if you actually included the new working query in your answer... ;)
    • Edited by MBorlund Thursday, July 18, 2019 6:00 AM typo
    Thursday, July 18, 2019 6:00 AM