Forum Discussion

Mayank Bansal's avatar
Mayank Bansal
Icon for Microsoft rankMicrosoft
Sep 13, 2019

Computer group in OMS query

I have two type of group Saved and active directory. I could run query on saved group as below

Perf | where Computer in (['ProdServers'])

 

How can i run the similar query for AD group. I could list the ad group member using the query below

ComputerGroup | where GroupSource == "ActiveDirectory" and Group == "SV_Prod" |distinct  Computer

 

  • HiMayank Bansal 

    You can do the following:

    let MyGroup = ComputerGroup | where GroupSource == "ActiveDirectory"  and Group == "SV_Prod  |distinct  Computer;
    Perf | where Computer in (MyGroup)

    Additionally you can save the results from:

    ComputerGroup | where GroupSource == "ActiveDirectory"  and Group == "SV_Prod  |distinct  Computer

    to a computer group let's say with name MySavedGroup and reference it in

    Perf | where Computer in (MySavedGroup)

    like any other computer group.

  • HiMayank Bansal 

    You can do the following:

    let MyGroup = ComputerGroup | where GroupSource == "ActiveDirectory"  and Group == "SV_Prod  |distinct  Computer;
    Perf | where Computer in (MyGroup)

    Additionally you can save the results from:

    ComputerGroup | where GroupSource == "ActiveDirectory"  and Group == "SV_Prod  |distinct  Computer

    to a computer group let's say with name MySavedGroup and reference it in

    Perf | where Computer in (MySavedGroup)

    like any other computer group.

Resources