WQL query for Device collection of SCOM managemnet servers and/or device collection of SCOM gateways

D D 6 Reputation points


I would like to create a SCCM dynamic device collection that includes SCOM management servers and another one that includes gateway servers? What WQL query I can use for this? are there any queries already available?

Microsoft Configuration Manager
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Garth Jones 1,301 Reputation points

    Let me turn this around on you. How do you know SCOM is installed on a computer? Once you answer that we can point you to making the WQL query.

    0 comments No comments

  2. D D 6 Reputation points

    Well, that's what I'm trying to figure out. I tried running a query for the Uninstall entry, but it didn't work. So, I was wondering if we have a ready recipe?

    0 comments No comments

  3. Sherry Kissinger 2,636 Reputation points

    Based on your reply, you do normally see something when you interactively look at a server, at Programs and Features, correct? Maybe you aren't looking at the "right" thing for CM. If you look in the console, pick a specific server that you personally KNOW has management server and/or gateway server installed, and right-click look at "resource explorer" for that specific device, you should see it listed under "Installed Software".

    If it's not there, look at all of the other things in resource explorer. Potential other ways to "tell" might be if there is a unique service under Services (if you inventory services).

    0 comments No comments

  4. CherryZhang-MSFT 6,441 Reputation points Microsoft Vendor

    Hi @D D ,

    I have done some tests and research on your question. We can query it by the special services used by SCOM management servers and gateway servers.

    1, Make sure that the service information is collected by "Hardware Inventory" Client Settings. For example:
    (By default, "Default Client Settings" already contains these. If not, please create it manually)


    2, Run hardware inventory to gather service information.

    3, Then run following query:

    > Select SMS_R_System.Name, SMS_G_System_SERVICE.DisplayName from SMS_R_System inner join SMS_G_System_SERVICE on SMS_G_System_SERVICE.ResourceId = SMS_R_System.ResourceId where DisplayName = "Servicename"

    Below is an example with a service, just for your reference:


    This thread for your reference:
    SCCM CB | WQL Query to find the specific Service is Running (microsoft.com)

    Looking forward to your feedback.

    Best regards

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.