Maximum Last Report Time for computers

Oops, forgot to limit it to only “real” computers. Each place we retrieve “BES Computers”, we’ll want to filter to

bes computers whose (agent type of it = "Native")

The final query, then, would be

(
/* Properties of the computer (item 0 of it) with the minimum last report times */
id of item 0 of it, name of item 0 of it, last report time of item 0 of it, 

/* Properties of the computer (item 0 of it) with the maximum last report times */
id of item 1 of it, name of item 1 of it, last report time of item 1 of it

) of 

(
/* Computer with the minimum last report time, among computers with this name */
items 0 of (elements of it, it) 
    whose (last report time of item 0 of it = minimum of last report times of elements of item 1 of it)

/* Computer with the maximum last report time, among computers with this name */
, items 0 of (elements of it, it) 
    whose (last report time of item 0 of it = maximum of last report times of elements of item 1 of it)
) of 
(
  set of items 0 of (bes computers whose (agent type of it = "Native"), it) 
    whose (name of item 0 of it = item 1 of it)
) of 
(
  unique values whose (multiplicity of it > 1) of names of bes computers 
    whose (agent type of it = "Native")
)

With that in place, my deployment only has one truly duplicated computer

49671, ENDPOINT-1, ( Tue, 05 May 2020 12:16:58 -0600 ), 1081605978, ENDPOINT-1, ( Wed, 13 Jan 2021 16:07:19 -0600 )

3 Likes