locked
WQL like operator not working for REF property. RRS feed

  • Question

  • gwmi -Query "SELECT * FROM Win32_Service WHERE Name LIKE '%Logon%'"  (works fine)

    returns some set of results. But when I run a similar query on some other class REF property ex: Win32_DependentService over Antecedent property the query is invalid.

    gwmi -Query "select * from Win32_DependentService where Antecedent like '%'" (doesn't work) (this is for example, my intention is not to display all the entries in Win32_DependentService, and I have a proper like clause for that.)

    the above one tells the query is invalid.

    gwmi -Query "select * from Win32_DependentService where Antecedent='\\\\XXXXXXX-machine\\root\\cimv2:Win32_SystemDriver.Name=`"ibbus`"'" this gives proper results.

    Why is it so? Is it because Antecedent property is REF?

    Please tell me the behavior with proper examples if possible, also how to use the 'like' in this case.

    Thanks

    Srikar.


    • Edited by srikar r Monday, September 3, 2012 12:12 PM
    Monday, September 3, 2012 12:11 PM