The Device Was Compliant Yesterday — Today It Wasn't Even Managed
Yesterday, the laptop was enrolled, compliant and permitted to access Microsoft 365.
Today, the help desk could not find it in Intune — but sign-in activity still appeared under the user's account.
“Was the laptop compliant?”
“Yesterday, yes.”
“And today?”
“Today, we're not entirely sure which laptop we're talking about.”
Agent Foskett stared at the device list. “Excellent. We've lost the device, but at least the confusion is fully managed.”

Case file: The missing managed device
A fictional, evidence-led investigation into Intune enrollment, Entra device identity, Conditional Access decisions and suspicious sign-in context.
The alert that made no sense
Was the laptop retired? Had someone removed the management profile? Was the user signing in from a replacement device? Or was the device identifier in the sign-in record stale or misleading?
This is a fictional case study. All identities, times and events are illustrative. The purpose is to demonstrate an evidence-based investigation, not to imply that every missing Intune record indicates compromise.
Three states that must not be confused
A device can have an Entra record without a corresponding active Intune enrollment. Compliance can become stale or change as policies and check-ins evolve. And a sign-in record may include device information without proving that a currently managed, healthy endpoint generated the event.
Start with the identifiers, not the display name
In the fictional case, investigators found an old Intune record identifier in a help-desk ticket, but a different device identifier in recent sign-ins. That mismatch became the central question, not proof of malicious activity.
KQL: Review sign-ins and Conditional Access outcomes
SigninLogs, inspect device details, authentication status and Conditional Access outcomes together. The DeviceDetail column is dynamic; fields can be missing or empty. A successful sign-in does not necessarily mean a particular compliant-device policy applied: inspect the relevant policy details and exclusions in Entra.- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
// Microsoft Sentinel: requires Entra SigninLogs ingestion
let TargetUPN = "analyst@example.com";
SigninLogs
| where TimeGenerated > ago(7d)
| where UserPrincipalName =~ TargetUPN
| extend Device = todynamic(DeviceDetail)
| extend DeviceId = tostring(Device.deviceId),
DeviceName = tostring(Device.displayName),
Managed = tostring(Device.isManaged),
Compliant = tostring(Device.isCompliant)
| project TimeGenerated, UserPrincipalName, AppDisplayName,
IPAddress, DeviceId, DeviceName, Managed, Compliant,
ConditionalAccessStatus, ResultType, CorrelationId
| order by TimeGenerated descRead the Conditional Access result correctly
ConditionalAccessStatus field gives a useful high-level outcome, but it is not a substitute for the applied policy evaluation. Review the sign-in details in Entra, including which policies applied, were not applied or were report-only; check device filters, exclusions, grant controls, authentication strength and any session controls.For this case, a recent sign-in succeeded because the relevant application was outside the scope of the compliant-device policy. That finding explained the successful access without proving the endpoint was healthy or enrolled. A separate sign-in to a protected application had been blocked.
KQL: Look for device-related directory changes
AuditLogs table can show Entra directory changes when diagnostic ingestion is enabled. It may capture device registration, deletion and update events, but it is not a complete Intune device-management audit trail. Search broadly first and inspect the event payload rather than relying on one exact activity string.- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
// Microsoft Sentinel: requires Entra AuditLogs ingestion
AuditLogs
| where TimeGenerated > ago(14d)
| where Category =~ "Device" or ActivityDisplayName has "device"
| extend Initiator = tostring(InitiatedBy.user.userPrincipalName)
| project TimeGenerated, ActivityDisplayName, Category,
Result, Initiator, TargetResources, CorrelationId
| order by TimeGenerated descCheck the Intune audit trail separately
AuditLogs includes every Intune action.Also check enrollment restrictions, MDM authority, licensing, certificate status, Company Portal state, device check-in failures and whether the device was re-enrolled after a reset. Preserve relevant administrative audit records before taking corrective action.
KQL: Build a device-ID timeline from sign-ins
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
// Microsoft Sentinel: sign-in observations, not Intune history
let TargetUPN = "analyst@example.com";
SigninLogs
| where TimeGenerated > ago(14d)
| where UserPrincipalName =~ TargetUPN
| extend Device = todynamic(DeviceDetail)
| extend DeviceId = tostring(Device.deviceId),
DeviceName = tostring(Device.displayName),
Managed = tostring(Device.isManaged),
Compliant = tostring(Device.isCompliant)
| summarize FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated),
SignIns=count(), Apps=make_set(AppDisplayName, 10)
by DeviceId, DeviceName, Managed, Compliant
| order by LastSeen descWhat did the endpoint itself report?
Do not remove or re-enroll a potentially compromised endpoint before preserving the evidence needed to understand what happened.
A six-stage evidence timeline
The finding: A missing record is not a verdict
The more important control gap was that one Microsoft 365 application remained accessible without the intended compliant-device requirement. The team corrected the Conditional Access scope and validated the outcome with test sign-ins, rather than assuming the device disappearance alone explained every event.
Containment and recovery
For an operational enrollment failure, confirm device ownership, restore a supported management state, check compliance evaluation and test access to both protected and unprotected applications. Avoid applying blanket policy changes without assessing service accounts, break-glass access and business impact.
Practical defensive lessons
Most importantly, treat every observation as evidence with limits. A successful sign-in proves a request was accepted under the evaluated conditions; it does not certify the endpoint.
Agent Foskett closes the case
“The old record wasn’t. The replacement was.”
“And the sign-in?”
“One was blocked. One wasn’t covered by the policy.”
Agent Foskett picked up his coffee.
“There’s our problem. The laptop wasn’t the only thing missing. So was the policy scope.”
The Logs Already Knew!

