I have a query that I need to run on 2 different root servers but use the same relevance. Problem I’m running into is getting the computer name back. I used the excel plugin to create the query and it tacked on some extra stuff for the computer name, but that info doesn’t come back on the 2nd root server.
( item 0 of it as string & "|" &
item 1 of it as string & "|" &
(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 = "002324658399") of it)
of results of bes property "KR_Imaging-MacAddress");
(sets of items 0
of (computers of it, values whose (it as lowercase = "mj00e1af") of it)
of results of bes property "KR_Imaging-SerialNumber")),
bes property "ID",
bes property "Computer Name" and
(item 0 of it = 2299705214 and item 1 of it = 4 and item 2 of it = 1) of id of it),
bes property "Last Report Time")
I would hope/thing the extra “and (item 0 of it = 2299705214 and item 1 of it = 4 and item 2 of it = 1) of id of it)” could not be necessary, but it is. I ran the excel plugin on the 2nd root server and it gave new numbers in that query.
How do I make this query platform agnostic? I actually ran across this on another one of my calls I think after our patch 10 upgrade where I was only calling for bes property “Computer Name” and the query came back with "<none>"
for it.
Much appreciate the help!