Session Relevance guidance

Could someone please help me -
Need computerId and computername subscribed to custom site that have reported in within last 7 days.
Thanks.

Hey Nick, have you reviewed the Getting Started Guide for Session Relevance on the BES developer site?

Additionally, take a look at the Excel Connector utility as it will write some session relevance for you via the Excel integration.

Hey, yup. I was nearly there but struggling adding last report time.

( item 0 of it as string,
item 1 of it as string )
of (
(if (exists result (item 0 of it, item 1 of it) and
exists values of result (item 0 of it, item 1 of it) )
then (values of result (item 0 of it, item 1 of it))
else ("")),
(if (exists result (item 0 of it, item 2 of it) and
exists values of result (item 0 of it, item 2 of it) )
then (values of result (item 0 of it, item 2 of it))
else ("")))
of (
elements of intersection of (
(sets of items 0
of (computers of it, values whose (it as lowercase contains “my_site” as lowercase) of it)
of results of bes property “Subscribed Sites”)),
bes property “ComputerID”,
bes property “Computer Name”)

Here’s what I’ve come up with.

(item 0 of it as string & "$x$" & item 1 of it as string & "$x$" & (if ((year of date (local time zone) of it) as integer = 1980) then ("<none>") else ((year of it as string & "/" & month of it as two digits & "/" & day_of_month of it as two digits) of date (local time zone) of it & " " & (two digit hour of it as string & ":" & two digit minute of it as string) of time (local time zone) of it)) of (item 2 of it as time)) of ((if (exists result (item 0 of it , item 1 of it) and exists values of result (item 0 of it , item 1 of it)) then (concatenation "%0A" of values of result (item 0 of it , item 1 of it)) else ("<none>")) , (if (exists result (item 0 of it , item 2 of it) and exists values of result (item 0 of it , item 2 of it)) then (concatenation "%0A" of values of result (item 0 of it , item 2 of it)) else ("<none>")) , (if (exists result (item 0 of it , item 3 of it) and exists values of result (item 0 of it , item 3 of it)) then (concatenation "%0A" of values of result (item 0 of it , item 3 of it)) else ("<none>"))) of (elements of intersection of ((sets of items 0 of (computers of it , values whose (it as lowercase contains "patching") of it) of results of bes property "Subscribed Sites") ; (sets of items 0 of (computers of it , values whose (it as time > "fri, 05 feb 2021 00:00:00 -0500" as time) of it) of results of bes property "Last Report Time")) , bes property "ID" , bes property whose (name of it = "Computer Name" and id of it = (2299743654 , 4 , 1)) , bes property "Last Report Time")

Haven’t tested your code but it appears you have hard coded 7 days from today. I need computerid and computernames subscribed to my custom site that have reported in within the last 7 days.

I think this may be a bit simpler via

Q: (id of it, name of it) of subscribed computers whose (now - last report time of it < 7 * day) of all bes sites whose (name of it = “My-Custom-Site-Name”)

1 Like

that’s what I needed, thank you !