Help to filter computer groups

Hi, everyone. I trying to reproduce the filter of the image.

I need to list only Windows Servers AND that whose in one of the other 3 groups.
I tried the query bellow, but it brings all Windows Servers, Linux and AIX too.

Where can I put the AND condition like in the image?

(name of it)
of members of bes computer groups whose(name of it as lowercase as trimmed string = "Servers Windows" as trimmed string as lowercase)
of members of bes computer groups whose(
name of it as lowercase as trimmed string = "Producao" as trimmed string as lowercase or 
name of it as lowercase as trimmed string = "Campinas Transacional" as trimmed string as lowercase or 
name of it as lowercase as trimmed string = "Campo Bom Producao" as trimmed string as lowercase
)

Thanks

Try this & modify accordingly:

(names of it) of bes computers whose (operating system of it starts with "Win" AND device type of it starts with "Server" AND (name of bes computer groups of it as lowercase = "group1" OR name of bes computer groups of it as lowercase = "group2" OR name of bes computer groups of it as lowercase = "group3"))

If we want to keep it short:

(names of it) of bes computers whose (operating system of it starts with "Win20" AND (name of bes computer groups of it as lowercase = "group1" OR name of bes computer groups of it as lowercase = "group2" OR name of bes computer groups of it as lowercase = "group3"))

1 Like

Here’s an approach using set arithmetic:

intersection | *
union | +

I think IDs are easier to work with, so:

(names of it, ids of it) of bes computer groups
Servers Windows, 1000
Producao, 2000
Campinas Transacional, 3000
Campo Bom Producao, 4000

Now, using the IDs from the first query, the following session relevance will return the names of all of the computers present in the Windows Server computer group and also in one of the other three.

(names of elements /* computer objects */ of it) of (member set /* computer object set */ of bes computer group whose (id of it is 1000) * /* that intersects with the */ (union of member sets /* computer object sets */ of bes computer groups whose (id of it is contained by set of (2000; 3000; 4000))))

Without comments:

(names of elements of it) of (member set of bes computer group whose (id of it is 1000) * (union of member sets of bes computer groups whose (id of it is contained by set of (2000; 3000; 4000))))

Another approach would be to use the intersection property rather than the operator:

(names of elements of it) of (intersection of (member set of bes computer group whose (id of it is 1000); (union of member sets of bes computer groups whose (id of it is contained by set of (2000; 3000; 4000)))))
4 Likes