HomeNewsletterCommunityMVP FeedToolsArchiveBlogToday's NewsAboutServicesQuick Links Subscribe free
← Back to Blog
Autopilot Windows AutopilotIntuneEntra IDMicrosoft GraphDevice LifecyclePowerShell

You Deleted It From Intune and It Still Cannot Re-Enrol: Autopilot's Three-Object Problem

IA
Imran Awan
21 August 2026

A laptop comes back from a leaver. You open the Intune admin center, find the device, and hit Delete. The row disappears. Job done, inventory clean, ticket closed.

Six weeks later that same chassis is reissued to a new starter. It boots, reaches the out-of-box experience, and fails. Somewhere in your tenant, two records you never touched are still describing a device that no longer exists.

The short version

One Windows Autopilot device is three separate records. The Autopilot registration, the Intune managed device, and the Microsoft Entra ID device object each live in a different service. Microsoft states that completely removing a device from a tenant requires all three records to be deleted, in a specific order. Deleting one does not reliably delete the others, and Intune device clean-up rules only hide records rather than removing them from Entra ID. The companion script reads all three collections through Microsoft Graph. It joins them on serial number and device id, then reports every record that exists in one service but not the others.

The problem: one device, three records, no single delete button

Most admins learn device retirement as a single action. You delete the device from whichever blade you happened to have open, and you assume the platform cleans up behind you.

It does not. Microsoft says so directly in the manual registration article. "Completely removing a device from a tenant requires the device records in Intune, Microsoft Entra ID, and Windows Autopilot to all be deleted."

Three records. Three services. Three deletion paths. And the portal gives you no view that shows all three side by side.

The first trap is that two of those records live in the same admin center, in two lists that look almost identical. Microsoft calls this out explicitly, because people search the wrong list and conclude the device is gone.

intune.microsoft.comDevices › EnrollmentWindowsWindows Autopilot devices
Context: Microsoft documents that devices listed under Devices > Windows > Windows devices are not the same as the devices under Devices > Enrollment > Windows > Windows Autopilot > Devices. A registered device only joins the first list once the Autopilot registration succeeded and a licensed user has signed in on it. A device registered last quarter and never deployed will not appear in the Windows devices list at all.

The second trap is the failure mode. Stale objects rarely fail loudly at deletion time. They fail weeks later, on the next provisioning attempt, in a way that looks like an Autopilot bug.

Microsoft documents these specific symptoms of leftover records:

Watch out: BitLocker recovery keys for a Windows device are stored on the Entra ID device object. Microsoft states plainly that deleting a stale device also deletes the BitLocker keys stored on it. In its own words, "there's no way to recover BitLocker recovery keys after deleting the associated device." Back up any key you might still need before any cleanup pass, not after.

Why it happens: three lifecycles joined by two soft keys

A single delete does not cascade because these are three genuinely independent objects. Three services own them, and Microsoft Graph exposes them as three different resources.

Microsoft Graph v1.0 base: https://graph.microsoft.com/v1.0
RecordGraph resource and pathWhat it actually holds
Autopilot registrationwindowsAutopilotDeviceIdentity at /deviceManagement/windowsAutopilotDeviceIdentitiesHardware identity, serial number, product key, group tag, purchase order identifier, enrollment state, assigned user
Intune managed devicemanagedDevice at /deviceManagement/managedDevicesThe mobile device management enrollment: compliance state, last sync time, management agent, enrollment profile name, primary user
Entra ID device objectdevice at /devicesThe directory identity: trust type, account enabled, registration date, group membership, BitLocker keys, Windows Hello for Business keys

Each record is created at a different moment. The Autopilot registration is created when the hardware hash is uploaded. Microsoft documents that "when a Windows Autopilot device is registered, it automatically creates a Microsoft Entra object." The Intune managed device only appears when the device actually enrols.

What links them is not a database relationship. It is a pair of string properties that each service stores about the others.

JoinProperty on the leftProperty on the right
Autopilot to IntunewindowsAutopilotDeviceIdentity.managedDeviceIdmanagedDevice.id
Autopilot to Entra IDwindowsAutopilotDeviceIdentity.azureActiveDirectoryDeviceIddevice.deviceId
Intune to Entra IDmanagedDevice.azureADDeviceIddevice.deviceId
Fallback for all threewindowsAutopilotDeviceIdentity.serialNumbermanagedDevice.serialNumber

These are copies of an identifier, not enforced references. Nothing stops the record on one side from being deleted while the pointer on the other side keeps pointing at it. That is exactly what an orphan is.

Gotcha: the Graph reference marks azureActiveDirectoryDeviceId on the Autopilot resource as "to be deprecated". It is still the property returned in the v1.0 response today, so the join still works. Build your tooling so that swapping the join key is a one-line change, not a rewrite.

There is a fourth identifier worth knowing, because it is how Entra ID remembers that an object was ever an Autopilot device. Microsoft refers to it as the ZTDID, short for zero touch deployment identifier. It rides in the Entra device object's physicalIds collection.

Microsoft's stale-device guidance is explicit about what happens when you delete an Entra object that had a ZTDID and then try to reuse the device:

Watch out: the Graph documentation describes physicalIds as "For internal use only." Use it to find suspicious objects, never as the sole basis for a deletion decision. Confirm by serial number in the portal before anyone deletes anything.

What each delete actually does

This is the table nobody publishes, and it is the whole point of the post.

What you clickedWhat it removesWhat it leaves behind
Delete in Intune (Devices > All devices)The managedDevice record. For Windows this always triggers a Retire commandThe Autopilot registration and the Entra ID device object
Delete in the Windows Autopilot devices bladeThe windowsAutopilotDeviceIdentity registrationDepends on enrolment history. Microsoft states that for a device that is or was enrolled in mobile device management, "removing the Windows Autopilot registration doesn't automatically delete the Microsoft Entra device object"
Delete device in Microsoft Partner CenterOnly the Autopilot registrationEverything else. Microsoft states it does not unenrol the device from Intune and does not disjoin it from Entra ID
Intune device clean-up ruleNothing. It hides records from the portal and reportsAll three records. Microsoft states "Devices hidden from Intune aren't removed from Microsoft Entra ID"

That last row generates orphans quietly and at scale. Clean-up rules accept a value between 30 and 270 days, run on a schedule, and trigger no action on the device. A device vanishes from your Intune reporting while its Entra object and its Autopilot registration sit untouched.

Gotcha: Microsoft notes that a Delete action reported as Completed means the process finished on the server side. It "doesn't confirm that the client device finished the Retire." A green status in the device actions report is not proof the endpoint let go.

The client-side view of the same problem

The three records live in the cloud, but the device keeps its own copy of what it thinks it belongs to. When a re-enrolment fails, this key tells you whether the device believes it is registered at all.

HKLM\SOFTWARE\Microsoft\Provisioning\Diagnostics\Autopilot
ValueWhat it tells you during an orphan investigation
CloudAssignedTenantDomainThe Entra tenant the device is registered with. Microsoft documents that if the device is not registered with Windows Autopilot, this value is blank
CloudAssignedTenantIdThe tenant GUID matching that domain. Also blank when the device is not registered
AadTenantIdThe tenant GUID of the user who signed in. A mismatch against the assigned tenant produces an error for the user
TenantMatchedSet to 1 when the user's tenant matches the registration tenant. If 0, the user is shown an error and forced to start over
IsAutopilotDisabledSet to 1 when the device is not registered with Autopilot. Can also mean the profile could not be downloaded because of network or firewall problems
CloudAssignedOobeConfigA bitmap of which Autopilot out-of-box settings were configured
Registry Editor
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\Diagnostics\Autopilot
├─ CloudAssignedTenantDomain   REG_SZ   (value not set)
├─ CloudAssignedTenantId   REG_SZ   (value not set)
├─ IsAutopilotDisabled   REG_DWORD   0x00000001 (1)
├─ TenantMatched   REG_DWORD   0x00000000 (0)
└─ AadTenantId   REG_SZ   {aaaaaaaa-0b0b-1c1c-2d2d-333333333333}
Illustrative. Blank tenant values plus IsAutopilotDisabled = 1 is the signature of a device whose registration is gone.

The event log surface

Autopilot writes its own log. When you are chasing a device that will not re-provision, this channel tells you which of the three records the device could not find.

Applications and Services Logs > Microsoft > Windows > ModernDeployment-Diagnostics-Provider > Autopilot
Event IDTypeWhat it means for a three-object investigation
100WarningAutopilot policy not found. Usually temporary while the profile downloads
153InfoState changed, normally ProfileState_Unknown to ProfileState_Available. The registration was found
161InfoThe Autopilot profile downloaded successfully
163InfoDownload not required, the device is already provisioned. A profile is cached locally. Clean or reset to change this
807ErrorZtdDeviceIsNotRegistered. Validate that the hardware hash is uploaded and a profile is assigned. The classic missing-registration signature
809ErrorZtdDeviceHasNoAssignedProfile, assigned profile does not exist. The profile was deleted without cleanup. Assign another and retry
815ErrorZtdDeviceHasNoAssignedProfile, no profile assigned and no default profile in the tenant
908ErrorSerialNumberMismatch or ProductKeyIdMismatch. The recorded serial or product key does not match the hardware. Re-register, then re-enrol
Event Viewer  —  Autopilot
LevelDate and TimeEvent IDSource
Information08:41:02160Autopilot
Warning08:41:09100Autopilot
Error08:41:44807Autopilot
Error08:42:07908Autopilot
Information08:42:31163Autopilot

How to verify: read all three collections and join them yourself

Verification comes before deletion, always. You want to know which of the three records exists before anyone clicks anything.

Step 1: check the Autopilot registration

intune.microsoft.comDevices › WindowsEnrollmentWindows Autopilot › Devices
  1. Sign in to the Microsoft Intune admin center.
  2. Select Devices in the left pane.
  3. Under By platform, select Windows.
  4. Under Device onboarding, select Enrollment.
  5. Under Windows Autopilot, select Devices.
  6. Use Search by serial number to find the device.
  7. Select Sync, then Refresh, if the list looks out of date.

Step 2: check the Intune managed device

intune.microsoft.comDevicesAll devices
  1. In the same admin center, select Devices > All devices.
  2. Search for the device name, or filter by serial number.
  3. Open the device and note the Serial number shown on the properties page.
Tip: writing down the serial number here is not busywork. Microsoft's own deregistration steps tell you to note it before deleting. Once the Intune record is gone, the serial number is the only practical way to find the matching Autopilot registration.

Step 3: check the Entra ID device object

entra.microsoft.comDevicesAll devices
  1. Open the Microsoft Entra admin center.
  2. Go to Devices > All devices.
  3. Search by device name, and check the Activity column.
  4. Note the Join type, which drives what you do at the end of the process.

The Activity column is the property Microsoft calls the activity timestamp, exposed in Graph as approximateLastSignInDateTime. Microsoft is specific that it is not an audit trail. It is only re-evaluated when the delta exceeds 14 days, with a plus or minus 5 day variance. Microsoft therefore warns against treating a timestamp younger than 21 days as an indicator of staleness.

Context: there is no Group Policy setting and no configuration service provider that governs any of this. Registration, enrolment, and directory object lifecycle are service-side records held by the Autopilot deployment service, Intune, and Entra ID. The only client-side surfaces are the diagnostics registry key above and dsregcmd /status. Do not go looking for an administrative template.
Command Prompt — on the device (illustrative output)
C:\> dsregcmd /status +----------------------------------------------------------------------+ | Device State | +----------------------------------------------------------------------+ AzureAdJoined : YES EnterpriseJoined : NO DomainJoined : NO DeviceId : aaaaaaaa-0b0b-1c1c-2d2d-333333333333 TenantName : Contoso TenantId : bbbbbbbb-1c1c-2d2d-3e3e-444444444444 # HEALTHY: this DeviceId exists as device.deviceId in Entra ID, and as # azureADDeviceId on the matching Intune managedDevice record. # BROKEN: the client reports a DeviceId that no directory object owns. # That is a client which outlived its Entra device object.

The same question can be asked of the registry, which is useful when you only have a remote session and no portal access.

PowerShell — on the device (run elevated), illustrative output
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Provisioning\Diagnostics\Autopilot' CloudAssignedTenantDomain : CloudAssignedTenantId : IsAutopilotDisabled : 1 TenantMatched : 0 AadTenantId : {aaaaaaaa-0b0b-1c1c-2d2d-333333333333} # HEALTHY: CloudAssignedTenantDomain and CloudAssignedTenantId are both # populated, and IsAutopilotDisabled is absent or 0. # BROKEN: blank tenant values with IsAutopilotDisabled = 1, as above. # Microsoft documents both blanks as meaning the device is not registered # with Windows Autopilot. TenantMatched = 0 means the signed-in user's # tenant does not match the registration tenant, so OOBE will error out.

Step 4: audit the whole tenant at once

Checking one device is fine for a ticket. Finding the orphans you do not know about needs a tenant-wide join, and that means Microsoft Graph.

Three collections, three least-privilege read scopes. Every one of these is documented on the relevant Graph reference page.

CollectionEndpointLeast-privilege read scope
Autopilot registrationsGET /deviceManagement/windowsAutopilotDeviceIdentitiesDeviceManagementServiceConfig.Read.All
Intune managed devicesGET /deviceManagement/managedDevicesDeviceManagementManagedDevices.Read.All
Entra ID device objectsGET /devicesDevice.Read.All

The companion script does exactly that, then reports six classes of finding.

CodeWhat it meansTypical cause
AP-NO-INTUNEAutopilot registration claims an Intune enrolment that no longer existsSomeone deleted the Intune record and stopped there
AP-NO-ENTRAAutopilot names an Entra device id with no matching directory objectThe Entra object was hand-deleted. Self-deploying and pre-provisioning will fail
INTUNE-NO-ENTRAIntune record names an Entra device id with no matching objectEntra cleanup ran without retiring in Intune first. Conditional Access has nothing to evaluate
ENTRA-NO-INTUNEEntra thinks the object is managed, but Intune has no recordA device clean-up rule hid the Intune record, or it was deleted directly
ENTRA-NO-APEntra object carries a ZTDID but no Autopilot registration matchesDeregistered from Autopilot while the directory object stayed. Dynamic groups keyed on ZTDID still catch it
AP-NEVER-SEENRegistered, enrollmentState of notContacted, never contacted the serviceNormal for stock on a shelf. Suspicious for hardware you believe is deployed
Tip: the script refuses to report a clean result it cannot stand behind. It verifies every requested scope is actually present on the token, aborts on any failed page of any collection, and enforces a -MinimumRecords floor. An empty collection would make every record in the other two services look orphaned, so it exits 1 rather than printing a reassuring zero.

The fix: the documented order, and cleaning up what you already have

There is one documented order. Microsoft states that skipping steps or removing records out of order "can result in orphaned records or unrecoverable devices."

Step 1: delete from Intune first

intune.microsoft.comDevices › WindowsDevice nameDelete
  1. Sign in to the Microsoft Intune admin center.
  2. Select Devices, then under By platform select Windows.
  3. Find the device under Device name and select it.
  4. Note the Serial number on the properties screen.
  5. Select Delete in the toolbar.
  6. Select Yes to confirm.

Step 2: deregister from Windows Autopilot

intune.microsoft.comDevices › EnrollmentWindows Autopilot › DevicesDelete
  1. Confirm step 1 completed.
  2. Go to Devices > Windows, then under Device onboarding select Enrollment.
  3. Under Windows Autopilot, select Devices.
  4. Find the device using Search by serial number.
  5. Select the checkbox next to the device.
  6. Open the menu on that row. If Unassign user is available, select it and confirm with OK.
  7. With the device still selected, choose Delete in the toolbar and confirm with Yes.
  8. Select Sync to accelerate the process, then Refresh every few minutes until the device disappears.

Step 3: do nothing in Entra ID, unless the join type says otherwise

Join typeWhat Microsoft says to do
Microsoft Entra joinedNo additional steps are required after deregistering through Intune. "Avoid manually deleting the device from Microsoft Entra ID, as this can cause unexpected issues"
Microsoft Entra hybrid joinedDelete the computer object from on-premises Active Directory Domain Services so it is not resynced. No further Intune or Autopilot action is needed, and again avoid manually deleting from Entra ID
Watch out: Microsoft's stale-device guidance goes further. "Don't delete system-managed devices. These devices are generally devices such as Autopilot. Once deleted, these devices can't be reprovisioned." The Autopilot FAQ adds that the Entra object "acts as Windows Autopilot's anchor in Microsoft Entra ID for group membership and targeting, including the profile." If that object is already gone, the documented recovery is to delete and reimport the device as an Autopilot device, which recreates the associated object.

How long to wait

Microsoft says the deregistration process "might take some time" and that selecting Sync accelerates it. For imports it says the sync "might take several minutes." No fixed propagation figure is published for the deregistration path, so treat any specific number you see quoted elsewhere as folklore. Poll with Refresh and confirm by absence.

Gotcha: Microsoft documents daily tenant limits that bite during bulk cleanup. A tenant can submit up to 1,000 Delete actions per day and up to 500 Wipe actions per day. Both limits are cumulative across individual device actions, bulk actions, and Graph API requests. Plan a large retirement programme across several days, or open a support request to raise the limit.

Working through the orphans you already have

Reverse-engineering a clean state from a messy one is not the same as retiring a device correctly. Handle each finding class differently.

Tip: Microsoft's stale-device guidance recommends disabling before deleting, because "you can't undo a deletion if there's a false positive." Set accountEnabled to false, wait out a documented grace period, and only then delete. Cloud Device Administrator or Intune Administrator is enough to make that change.

Proof it worked: the same audit, run twice

The only honest proof is a before-and-after from the same tenant-wide join. Run the script, do the cleanup, run it again.

PowerShell 7 — example output (illustrative, not a live tenant capture)
# BEFORE cleanup PS> .\Get-AutopilotOrphanedObjectReport.ps1 ========================================================================== AUTOPILOT / INTUNE / ENTRA ID CROSS-OBJECT ORPHAN REPORT ========================================================================== Read-only. GET requests only. Nothing is deleted or modified. Connecting to Microsoft Graph with read-only scopes... DeviceManagementServiceConfig.Read.All DeviceManagementManagedDevices.Read.All Device.Read.All Connected. Account: admin@contoso.onmicrosoft.com [1/3] Reading Windows Autopilot device registrations Autopilot registrations: 412 records retrieved. [2/3] Reading Intune managed device records Intune managed devices: 588 records retrieved. Windows managed devices: 401 [3/3] Reading Microsoft Entra ID device objects Entra device objects: 730 records retrieved. Windows Entra device objects: 438 ========================================================================== SUMMARY ========================================================================== AP-NO-INTUNE 7 Autopilot registration with no matching Intune record AP-NO-ENTRA 2 Autopilot registration with no matching Entra device object INTUNE-NO-ENTRA 0 Intune record with no matching Entra device object ENTRA-NO-INTUNE 19 Entra object flagged managed with no Intune record ENTRA-NO-AP 5 Entra object with a ZTDID but no Autopilot registration AP-NEVER-SEEN 23 Autopilot registration never contacted (informational) Actionable cross-object orphans: 33 # AFTER working through the documented order, same script, same scopes PS> .\Get-AutopilotOrphanedObjectReport.ps1 AP-NO-INTUNE 0 Autopilot registration with no matching Intune record AP-NO-ENTRA 0 Autopilot registration with no matching Entra device object INTUNE-NO-ENTRA 0 Intune record with no matching Entra device object ENTRA-NO-INTUNE 0 Entra object flagged managed with no Intune record ENTRA-NO-AP 0 Entra object with a ZTDID but no Autopilot registration AP-NEVER-SEEN 23 Autopilot registration never contacted (informational) No cross-object orphans found in the records that were read. This is a real clean result: all three collections were read in full.
Microsoft Intune admin center  —  Windows Autopilot device (illustrative)
Serial number SERIAL-REDACTED
Group tag Standard-Laptop
Enrollment state enrolled
Associated Intune device Not found
Entra device id {aaaaaaaa-0b0b-1c1c-2d2d-333333333333}
Last contacted 2026-03-04

That combination is the textbook AP-NO-INTUNE orphan. Autopilot still reports the device as enrolled, because the enrolment state on the registration record is a stored value rather than a live lookup. The Intune record it points at is gone.

Context: a zero is only meaningful if the run that produced it was complete. That is why the script fails loud on a missing scope, a failed page, or a suspiciously empty collection. A report that cannot distinguish "no orphans" from "no data" is worse than no report, because it ends the investigation.

Verified community deep-dives

AuthorArticleWhy it is relevant here
Peter van der WoudeUsing device clean-up rules in Microsoft IntuneStates directly that clean-up rules do not affect device objects in Microsoft Entra, and that they hide rather than delete
Rudy OomsAutopilot for pre-provisioned deployment and the lost Azure/Entra Ad JoinWalks a real case where a device looked joined in the portal but was not, and removing the directory object while keeping the Autopilot registration restored the join

References

PowerShell Scripts — Autopilot Orphaned Objects

Download it from Imran76Awan/Windows-Autopilot-Scripts — no sign-in required. It is read-only: it reports and never changes a device or anything in Intune. Validate it in your own environment before relying on the output.

Get-AutopilotOrphanedObjectReport.ps1 — cross-object orphans across Autopilot, Intune and Entra
View all scripts on GitHub
Was this post helpful?
React below — no account needed
Share this post
LinkedIn X / Twitter Reddit Bluesky

More from EndpointWeekly

Autopilot
Assign User Does Not Lock the Device: What Autopilot…
Assigning a user to an Autopilot device writes two strings to a cloud object and…
Autopilot
Who Owns the Device After Autopilot: Primary User, Device…
Intune sets a device primary user from whoever completed OOBE. That drives Company…
Autopilot
The Clock Is the First Dependency: How Time Skew Breaks…
Kerberos and OAuth both authenticate with timestamps, so a device with a dead CMOS…