none
Quick way to see what my wmi query string filters out? RRS feed

  • Question

  • Is there a quick way to see which computers my wmi query will affect?

    For example if I use: "select * from Win32_OperatingSystem where (ProductType = "2") OR (ProductType = "3")", I'd like to see a list of which computers will fall within that filter.

    This would very helpful for creating wmi filters in Group Policy as it would let me know the computers i intend to filter are actually being selected by the wmi query.

    Everything I've found so far only allows me to run it on my local PC or on a remote machine but i want to see the results of the entire domain all at once.

    Tuesday, September 27, 2016 3:35 PM

Answers

  • The reason is that you have to hit WMI on each computer to tell whether the filter applies to it or not.

    If you have more than a few computers, looping through all computers in AD and connecting to each one's WMI service can be a problem for various reasons (inaccessible computers, firewalls, slow network connections, etc.).


    -- Bill Stewart [Bill_Stewart]

    Tuesday, September 27, 2016 4:23 PM
    Moderator

All replies

  • Why? Is it not working?


    -- Bill Stewart [Bill_Stewart]

    Tuesday, September 27, 2016 3:43 PM
    Moderator
  • No, it is working.

    But I am curious about the results. If I change the query, I'd like to be able to SEE the result before applying it to a GPO. I just don't see a way to test the string. Group Policy Management is obviously working and able to "see the results"... so why can't I see the results (a list of which computers are affected)? 

    Tuesday, September 27, 2016 4:08 PM
  • The reason is that you have to hit WMI on each computer to tell whether the filter applies to it or not.

    If you have more than a few computers, looping through all computers in AD and connecting to each one's WMI service can be a problem for various reasons (inaccessible computers, firewalls, slow network connections, etc.).


    -- Bill Stewart [Bill_Stewart]

    Tuesday, September 27, 2016 4:23 PM
    Moderator