## Error message
```text
Error code: 80070002 during Windows Autopilot enrollment.
```

## TL;DR
Read the failure from the logs instead of guessing: the MDM diagnostics and the Intune management extension log show exactly which enrollment step returned 80070002. Match the failing step to an app, certificate, or policy, fix that item in Intune, and reset the device.

## Steps
1. Generate the MDM diagnostics log on the device and open the enrollment section.
   Expected: The log shows the enrollment phases and where 80070002 first appears.
2. Cross-check the timestamp in the Intune management extension log.
   Expected: Both logs point at the same app install or policy application.
3. In Intune, inspect that app's install behavior and detection rules for missing files or paths.
   Expected: The broken reference is identified.
4. Correct the app package or remove the assignment, then reset and re-enroll.
   Expected: Enrollment completes.

## When to use
- Searching the code 80070002 brings you here from a failed Autopilot run
- You need the log locations before touching Intune assignments
- The same code appears on multiple device models (points at content, not hardware)

## When not to use
- The code appears after enrollment during normal app deployment (use the Intune app-failure flow)
- No logs are available because the device was already wiped (reproduce first)
- The failure is at the ESP apps phase with a different code

## Why this happens
Autopilot runs enrollment as a sequence of MDM commands; each step's result code lands in the diagnostics logs. 80070002 in those logs almost always traces to content the device was told to fetch that was not actually there.

## Edge cases
- Timestamps between the two logs can differ by the device clock skew; match by step name too.
- Export the logs before resetting, or the evidence is gone.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_-4_lZOttxNmzr3x1iS6pWA
