How to User Device Query in Intune

Device Query will help you to collect the n-demand device information  quickly. Device query runs in a real-time and will provide real-time data from the device. 

Prerequisites

Microsoft Intune Advanced Analytics should be activated on Tenant You should have below license to use Device Query feature.

  • Intune Advanced Analytics Add-on.
  • Microsoft Intune Suite.

To use Device query on a device, the device must be enrolled in Endpoint Analytics. 

To use Device Query, Go to Devices and then All Devices then search device then click on Device Query as showing in below screen.


Supported Properties

Device query supports the following entities. To learn more about what properties are supported for each entity, see Intune Data Platform Schema.

  • BiosInfo

  • Certificate

  • Cpu

  • DiskDrive

  • EncryptableVolume

  • FileInfo

  • LocalGroup

  • LocalUserAccount

  • LogicalDrive

  • MemoryInfo

  • OsVersion

  • Process

  • SystemEnclosure

  • SystemInfo

  • Tpm

  • WindowsAppCrashEvent

  • WindowsDriver

  • WindowsEvent

  • WindowsQfe

  • WindowsRegistry

  • WindowsService


Table Operators

Table operators can be used filter, summarize, and transform data streams. Currently the following operators are supported:

OperatorsDescription
countReturns a table with a single record containing the number of records
distinctProduces a table with the distinct combination of the provided columns of the input table
joinMerge the rows of two tables to form a new table by matching row for the same device
order bySort the rows of the input table into order by one or more columns
projectSelect the columns to include, rename or drop, and insert new computed columns
takeReturn up to the specified number of rows
topReturns the first N records sorted by the specified columns
whereFilters a table to the subset of rows that satisfy a predicate

Scalar operators 

The following table summarizes operators:

OperatorsDescriptionExample
==Equal1 == 1, ‘aBc’ == ‘AbC’
!=Not Equal1 != 2, ‘abc’ != ‘abcd’
<Less1 < 2, ‘abc’ < ‘DEF’
>Greater2 > 1, ‘xyz’ > ‘XYZ’
<=Less or Equal1 <= 2, ‘abc’ <= ‘abc’
>=Greater or Equal2 >= 1, ‘abc’ >= ‘ABC’
+Add2 + 1, now() + 1d
Subtract2 – 1, now() – 1h
*Multiply2 * 2
/Divide02-Jan
%Modulo2 % 1
likeLeft Hand Side (LHS) contains a match for Right Hand Side (RHS)‘abc’ like ‘%B%’
!likeLHS doesn’t contain a match for RHS‘abc’ !like ‘_d_’
containsRHS occurs as a subsequence of LHS‘abc’ contains ‘b’
!containsRHS doesn’t occur in LHS‘team’ !contains ‘i’
startswithRHS is an initial subsequence of LHS‘team’ startswith ‘tea’
!startswithRHS isn’t an initial subsequence of LHS‘abc’ !startswith ‘bc’
endswithRHS is a closing subsequence of LHS‘abc’ endswith ‘bc’
!endswithRHS isn’t a closing subsequence of LHS‘abc’ !endswith ‘a’
andTrue if and only if RHS and LHS are true(1 == 1) and (2 == 2)
orTrue if and only if RHS or LHS is true(1 == 1) or (1 == 2)

Aggregation functions

Aggregation functions can be used with the summarize table operator to calculate summarized values. Currently the following aggregation functions are supported:

 
FunctionDescription
avg()Returns the average of the values across the group
count()Returns a count of the records per summarization group
countif()Returns a count of rows for which Predicate evaluates to true
dcount()Returns the number of distinct values in the group
max()Returns the maximum value across the group
maxif()Starting in version 2107, you can use maxif with the summarize table operator.
 
Returns the maximum value across the group for which Predicate evaluates to true.
min()Returns the minimum value across the group
minif()Starting in version 2107, you can use minif with the summarize table operator.
 
Returns the minimum value across the group for which Predicate evaluates to true.
percentile()Returns an estimate for the specified nearest-rank percentile of the population defined by Expr
sum()Returns the sum of the values across the group
sumif()Returns a sum of Expr for which Predicate evaluates to true

Scalar functions

Scalar functions can be used in expressions. Currently the following scalar functions are supported:

FunctionDescription
ago()Subtracts the given timespan from the current UTC clock time
bin()Rounds values down to many datetime multiple of a given bin size
case()Evaluates a list of predicates and returns the first result expression whose predicate is satisfied
datetime_add()Calculates a new datetime from a specified datepart multiplied by a specified amount, added to a specified datetime
datetime_diff()Calculates the difference between two date time values
iif()Evaluates the first argument and returns the value of either the second or third arguments depending on whether the predicate evaluated to true (second) or false (third)
indexof()Function reports the zero-based index of the first occurrence of a specified string within input string
isnotnull()Evaluates its sole argument and returns a Boolean value indicating if the argument evaluates to a non-null value
isnull()Evaluates its sole argument and returns a Boolean value indicating if the argument evaluates to a null value
now()Returns the current UTC clock time
strcat()Concatenates between 1 and 64 arguments
strlen()Returns the length, in characters, of the input string
substring()Extracts a substring from a source string starting from some index to the end of the string
tostring()Converts input to a string representation