Query Details

Compliance Notcompliant Devices

Query

IntuneDeviceComplianceOrg
| where todatetime(LastContact) > ago(30d)
| where ComplianceState == "Not compliant"
| summarize arg_max(TimeGenerated, *) by DeviceName
| project ComplianceState, DeviceName, LastContact

Explanation

This query is checking the compliance status of devices in an organization using Intune Device Compliance. It filters out devices that have not been in contact for more than 30 days and those that are not compliant. It then returns the most recent record for each device based on the time the data was generated. The final output of the query will show the compliance state, device name, and the last contact time.

Details

Ugur Koc profile picture

Ugur Koc

Released: July 10, 2022

Tables

IntuneDeviceComplianceOrg

Keywords

Intune,Devices,ComplianceState,DeviceName,LastContact,TimeGenerated

Operators

todatetime()ago()where()summarize()arg_max()project()==>

Actions