Fetch the Computer Id using Computer name

Hi

I am using the below api query to fetch the computer Id.

https://Host:52311/api/query?relevance=(ids%20of%20it)%20of%20bes%20computers%20whose%20((name%20of%20it%20as%20string%20starts%20with%20"ComputerName"))

But in the above query the computer name is case sensitive so if the computer name doesn’t match with the computer name (Same computer name but case sensitive) present in the Tem server then it returns nothing.

Could anybody Kindly help me with a query which can resolve this problem.

I would also like to understand an api query which will fetch the last reporting time of the server.

Regards,

Athul

For the session relevance query, you can simply cast both sides of the string comparison to ‘as lowercase’ or ‘as uppercase’ to avoid case sensitivity. Some examples:

"A" = "a" -> FALSE
("A" as lowercase) = ("a" as lowercase) -> TRUE

You could also use regex to accomplish this as well.

Here’s a sample session relevance query that returns the ID, Computer Name, and Last Report Time in a single query filtered on a given computer name without case sensitivity:

(id of it, name of it, last report time of it) of bes computers whose (name of it as lowercase starts with "ComputerName" as lowercase)

1 Like

Thank you Aram

If I want to check weather the last reporting time is one day behind or one hour behind in the below query how can I do that.

(id of it, name of it, last report time of it) of bes computers whose (name of it as lowercase starts with “ComputerName” as lowercase)

Hi Aram

Could you please help me with a query which will confirm me that the server is reporting to TEM or not?

Thanks

Here’s a variation that will return True or False based on if the device reported in within the last day:

(id of it, name of it, last report time of it > (now - 1 * day)) of bes computers whose (name of it as lowercase starts with "ComputerName" as lowercase)

1 Like