HomeNewsletterCommunityMVP FeedToolsArchiveBlogToday's NewsAboutServicesQuick Links Subscribe free
← Back to Blog
Autopilot Windows AutopilotMicrosoft Defender for EndpointIntuneEndpoint SecurityEDRPowerShell

Enrolled Is Not Protected: Defender for Endpoint Onboarding During Autopilot

IA
Imran Awan
21 August 2026

A new laptop finishes Windows Autopilot. The user reaches the desktop, signs in, and starts working. In the Microsoft Intune admin center the device appears as enrolled and compliant. Every box on the deployment checklist is ticked.

Three weeks later a security analyst runs a hunting query across the estate. That laptop is not in the results. It was never in the results. The device has been enrolled, managed and compliant the whole time, and it has never sent a single byte of sensor data to Microsoft Defender for Endpoint.

The short version

Enrolling a device in Intune and onboarding it to Microsoft Defender for Endpoint (MDE) are two separate operations with two separate success signals. Onboarding is driven by a policy, and the sensor that acts on that policy will not complete its first start until the out-of-box experience (OOBE) has finished. That is documented behaviour, not a bug. The device-side truth lives in one registry value that Microsoft documents as 0 for not onboarded and 1 for onboarded, plus the state of the Sense service. Neither of those is what an Intune compliance dashboard shows you, so a device can sit enrolled but unprotected indefinitely unless you go looking. The companion script reads that surface and tells you which of the three states the device is actually in.

The problem: enrolled in Intune, invisible to Defender

Autopilot gives you a satisfying green tick at the end of provisioning. That tick means the device joined Microsoft Entra ID, enrolled with Intune, and completed the Enrollment Status Page. It does not mean the device is protected.

Microsoft Defender for Endpoint is not switched on by enrollment. It is switched on by onboarding, which is a distinct step. Microsoft describes it plainly: "Device onboarding configures your managed devices to communicate with Defender for Endpoint" and "Device onboarding is a one-time action per device". Until that action completes, the sensor has no tenant to talk to.

The gap is easy to miss because the two states are reported in different places. Enrollment shows up in Intune. Onboarding shows up in the Microsoft Defender portal device inventory.

security.microsoft.comAssets › DevicesDevice inventory
Context: two states, two owners. Intune owns "is this device enrolled and does it have my policies". Defender for Endpoint owns "is this device running a sensor that reports to my tenant". A device can be perfect on the first question and absent on the second, and nothing in the Intune device blade will shout about it.

The timings that make the gap invisible

The published expectations are wide enough that a genuinely broken device looks like a slow one for days. These are Microsoft's own figures, drawn from five different articles.

StageDocumented expectationWhy it matters
Connector status refresh in IntuneConnection status can take up to 15 minutes to updateAn admin who checks immediately after enabling it sees the old value
EDR policy deployed to portal visibilityAfter 15 to 30 minutes, devices should appear in the Defender portal device inventoryThis is the happy-path figure most people remember
Onboarding completed on the deviceEvent 11 is logged, then "it might take several hours for the device to appear in the portal"Several hours of legitimate silence hides a real failure
Failure threshold"If you've completed the onboarding process and don't see devices in the Devices list after an hour, it might indicate an onboarding or connectivity problem"One hour is Microsoft's own suspicion threshold
Group Policy onboarding route"It can take several days for devices to start showing on the Devices list"Covers policy distribution, user logon, and the endpoint starting to report

Read that table again. Somewhere between fifteen minutes and several days, silence is normal. That is exactly the window in which a device that will never onboard looks identical to one that is about to.

Gotcha: the Enrollment Status Page does not close this gap for you. Microsoft states the ESP "tracks the installation of applications, security policies, certificates, and network connections". Tracking the installation of a security policy is not the same as confirming that the sensor read that policy, started, registered with the service and began reporting. Those later steps happen after the ESP is long gone.

Why it happens: onboarding is a second handshake, and OOBE gates it

To understand why the failure mode exists, follow the chain. There are six links, and each one can break on its own.

  1. The connector. A service-to-service connection is created between Intune and Defender for Endpoint. Microsoft calls this a one-time setup per tenant.
  2. The onboarding package. Microsoft states that "when you establish the service connection, Intune automatically receives an onboarding configuration package from Microsoft Defender for Endpoint". Without the connector, Intune has no package to hand out.
  3. The policy. An Endpoint detection and response (EDR) policy carries that package to the device. It has to be assigned to something.
  4. The policy landing. The management channel writes the onboarding blob into a registry key on the device.
  5. The sensor first start. The Sense service reads the blob, starts, and writes its own status key. Microsoft documents this exactly: "When the SENSE service starts for the first time, it writes onboarding status to the registry location HKLM\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status".
  6. The registration. The sensor registers with the authentication service and starts uploading sensor data. Only now does the device appear in the Defender portal.

Link five is where Autopilot specifically bites.

The sensor waits for OOBE, on purpose

Microsoft has a section titled "Confirming onboarding of newly built devices" that describes this scenario almost word for word. The onboarding package is deployed to newly built devices. The sensor does not start because the out-of-box experience or first user logon has not completed. The device is turned off or restarted before the end user performs a first logon. And then the payoff line: "in this scenario, the SENSE service won't start automatically even though onboarding package was deployed".

The sensor logs its own opinion about this. Three of its event IDs exist purely to report whether Windows Welcome has finished.

Event IDDocumented messageDocumented description
18OOBE (Windows Welcome) is completed.Service will only start after any Windows updates have finished installing.
19OOBE (Windows Welcome) hasn't yet completed.Service will only start after any Windows updates finish installing. If this persists after a restart, ensure all Windows updates are installed.
20Can't wait for OOBE (Windows Welcome) to complete. Failure code: variable.Internal error. If it persists after a restart, ensure all Windows updates are installed.
Tip: the first-logon requirement was relaxed. Microsoft notes that "User Logon after OOBE is no longer required for SENSE service to start" on Windows 10 version 1809 or later, Windows Server 2019 or later, and Azure Stack HCI OS version 23H2 and later. On a modern Autopilot build the gate is OOBE completion, not a human sitting down at the keyboard.

The two halves can disagree with each other

Because onboarding is a multi-step handshake, the sensor can be running while onboarding has not completed, or onboarded while the service is not running. Microsoft documents both as known non-compliance cases.

SymptomDocumented causeDocumented action
Compliant by SenseIsRunning, non-compliant by OrgId, Onboarding and OnboardingState"Check that user passed OOBE after Windows installation or upgrade. During OOBE onboarding couldn't be completed but SENSE is running already."Wait for OOBE to complete
Compliant by OrgId, Onboarding and OnboardingState, non-compliant by SenseIsRunningThe Sense service startup type is set as delayed start, so a device-management session at system start can report it as not running"The issue should automatically be fixed within 24 hours"
Device is non-compliantOnboarding and offboarding policies both reaching the deviceEnsure they are not deployed on the same device at the same time
Watch out: never let an onboarding policy and an offboarding policy target the same device. Microsoft states it in two separate articles: "To avoid unpredictable policy collisions, onboarding and offboarding policies must not be deployed at the same time on a device." Offboarding packages also expire seven days after download, and expired packages sent to a device are rejected. A stale offboarding assignment left in a group is both dangerous and silently useless.

The registry surface

Two separate parent keys are involved. Confusing them is the single most common reason a verification script reports the wrong answer. One is written by the management channel. The other is written by the sensor.

The management side first. This is where the onboarding blob arrives, and where the documented configuration values live.

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection
ValueDocumented meaningWhat to look for
The key itselfMicrosoft lists a documented failure cause as "Microsoft Defender for Endpoint Policy registry key doesn't exist or the OMA DM client doesn't have permissions to write to it". Onboarding-script error 10 is "Onboarding data couldn't be written to registry" and points at this same key.If the key is absent, no onboarding policy has ever reached the device
AllowSampleCollectionREG_DWORD. 0 means sample sharing is not allowed from the device. 1 means sharing of all file types is allowed, and 1 is the default if the value does not exist.Set by the EDR policy Sample Sharing setting
ForceDefenderPassiveModeREG_DWORD set to 1 to place Defender Antivirus in passive mode on Windows Server. Microsoft says it must be set before onboarding the device.Server-side only, and tamper protection changes its behaviour once active mode is reached

Now the sensor side. This key does not exist until the sensor has started at least once, which makes its absence a diagnostic in itself.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status
PropertyDocumented valuesReading
OnboardingStateMicrosoft documents the health state through the WindowsAdvancedThreatProtection configuration service provider (CSP): 0 (default) is Not onboarded, 1 is Onboarded. Onboarding-script error 40 is "SENSE service onboarding status isn't set to 1", which is the same semantics.1 is the only value that means protected
OrgIdThe CSP exposes HealthState/OrgId as "String that represents the OrgID".Presence proves the sensor has a tenant to report to. Never paste this value into a ticket
The key itselfWritten by the SENSE service on first start. Onboarding-script error 35 is "The script failed to find needed onboarding status registry value".An absent key means the sensor has never completed a first start
Registry Editor
▼ HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Advanced Threat Protection
  ▼ Status
        OnboardingState      REG_DWORD    0x00000000 (0)
        OrgId                (value not present)
        LastConnected        (value not present)
▼ HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection
        AllowSampleCollection REG_DWORD    0x00000001 (1)
        (onboarding blob)     REG_SZ       [blob present]
Illustrative. This is the exact fingerprint of the failure: the policy landed on the management side, but the sensor has not turned it into an onboarded state. Microsoft documents the Policies key as the onboarding blob's destination but does not publish the blob value name, so a verification script should enumerate the key rather than assume a name.

Antivirus mode is a different question entirely

People conflate "Defender is running" with "Defender for Endpoint is onboarded". They are unrelated measurements. Microsoft Defender Antivirus runs in one of three states, and the state depends partly on whether the device is onboarded.

Antivirus solution on the deviceOnboarded to Defender for Endpoint?Documented Defender Antivirus state
Microsoft Defender AntivirusYesActive mode
Microsoft Defender AntivirusNoActive mode
A non-Microsoft antivirus solutionYesPassive mode, automatically
A non-Microsoft antivirus solutionNoDisabled mode, automatically, on Windows 10 and Windows 11

Note the top two rows. Defender Antivirus in active mode tells you nothing about onboarding. Microsoft also states that "in general, Microsoft Defender Antivirus can be set to passive mode only on endpoints that are onboarded to Defender for Endpoint". That makes passive mode a weak positive signal and active mode no signal at all.

One more Autopilot-adjacent trap

The sensor is a Windows capability, not a downloaded agent. If it is missing, onboarding cannot succeed no matter how well the policy is written. Microsoft documents onboarding-script error 15 as covering exactly this: "The SENSE Feature on Demand (FoD) may not be installed", checked with a read-only DISM query against capability name Microsoft.Windows.Sense.Client~~~~. The CSP article carries the same warning from the other direction: "Windows 11 Home devices that have been upgraded to one of the below mentioned applicable editions might require you to run" the DISM add-capability command before onboarding. Any Autopilot fleet that includes edition-upgraded hardware should expect to meet this.

How to verify: five checks on the device, two in the portals

Verification has to be positive. "Nothing in the log" is not a pass, because a device whose sensor never started has an empty log by definition.

Checks 1 and 2: the registry state and the service

These two together answer most cases. Run them elevated, because both surfaces need administrator rights and read as empty otherwise.

PowerShell — on the device (run elevated)
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status' | Select-Object OnboardingState # Healthy: OnboardingState = 1. Microsoft documents 0 as Not onboarded and 1 as Onboarded. # A "property cannot be found" error means the sensor never wrote the value at all. Get-Service -Name Sense | Select-Object Name, Status, StartType # Healthy: Status = Running. Microsoft's own troubleshooting uses "sc query sense" for this. # Delayed start is documented as a normal configuration, so a brief Stopped window is not fatal. Test-Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection' # False means no onboarding policy has landed. Stop looking at the sensor, go look at the policy.
Gotcha: do not paste the org ID into a ticket, a chat message, or a screenshot. It identifies your tenant to anyone who reads it. Check that it is present and move on. The companion script deliberately reports presence only and never prints the value.

Check 3: the antivirus side

Microsoft's documented method for reading the antivirus mode is a single property. The values you should see when antivirus protection is enabled are Normal, Passive, or EDR Block Mode. Tamper protection is read from the same object, where a value of true means it is enabled.

PowerShell — on the device (run elevated)
Get-MpComputerStatus | Select-Object AMRunningMode, AMServiceEnabled, AntivirusEnabled, RealTimeProtectionEnabled, IsTamperProtected # AMRunningMode: Microsoft documents Normal, Passive and EDR Block Mode as the enabled values. # Anything else means antivirus protection is not in one of the documented enabled states. # IsTamperProtected: a value of true means tamper protection is enabled. Get-MpComputerStatus | Select-Object AntivirusSignatureLastUpdated, AntivirusSignatureAge # Before signatures update for the first time, the documented age is 65535 days. # A freshly provisioned device showing that number has not finished its first update cycle.

Check 4: the sensor event channel

The sensor writes to its own dedicated channel. In Event Viewer, open Applications and Services LogsMicrosoftWindowsSENSE and select Operational. Microsoft notes that SENSE is the internal name for the behavioural sensor that powers Defender for Endpoint. The full channel name for Get-WinEvent is below.

Microsoft-Windows-SENSE/Operational
Event Viewer
Warning19OOBE (Windows Welcome) hasn't yet completed
Error6Service isn't onboarded and no onboarding parameters were found
Info18OOBE (Windows Welcome) is completed
Info11Onboarding or reonboarding of Defender for Endpoint service completed
Info4Service contacted the server at [service URL]

That sequence is the story of a device that finished provisioning, waited for Windows Welcome, then onboarded. Event 11 is the one you are hunting for. Event 4 following it is the proof it is actually talking.

Here is the catalog for the same channel, restricted to the events that bear on onboarding. Microsoft publishes many more, covering quotas, cloud configuration and response commands.

Event IDDocumented messageWhat it tells you
1Service started (Version variable)Normal. Occurs at startup, shutdown and during onboarding
2Service shutdownNormal. Occurs on shutdown or offboarding
3Service failed to start. Failure code: variableRead the surrounding events for the cause
4Service contacted the server at variableThe sensor is genuinely reporting. Variable is the service URL
5Service failed to connect to the server at variableA connectivity or proxy problem, not an onboarding problem
6Service isn't onboarded and no onboarding parameters were foundThe policy never landed. Check the Policies registry key
7Service failed to read the onboarding parameters. Failure: variableThe blob is there but unusable. Redeploy the configuration package
9Service failed to change its start type. Failure code: variableDuring onboarding, this means the device did not onboard correctly
10Service failed to persist the onboarding information. Failure code: variableA registry write failed. Re-run onboarding
11Onboarding or reonboarding of Defender for Endpoint service completedSuccess. The portal may still take several hours
13Device ID calculated: variableNormal operating notification
17Failed to change the Connected User Experiences and Telemetry service locationA diagnostic data service problem. Re-run onboarding
18OOBE (Windows Welcome) is completedThe gate has opened
19OOBE (Windows Welcome) hasn't yet completedThe gate is closed. Expected on a mid-provisioning device
20Can't wait for OOBE (Windows Welcome) to complete. Failure code: variableInternal error. Confirm all Windows updates are installed
25Failed to reset health status in the registry. Failure code: variableReports to the portal but may not appear registered in the registry
26Failed to set the onboarding status in the registry. Failure code: variableSame shape as 25. Your registry check will lie to you
27Failed to enable SENSE aware mode in Microsoft Defender Antivirus. Onboarding process failedThe antivirus handoff failed. Confirm real-time protection is running
33Failed to persist SENSE GUID. Failure code: variableThe same device might appear twice in the portal
44Offboarding of Defender for Endpoint service completedSomething offboarded this device. Find out what
68The start type of the service is unexpected. Service name, actual start type, expected start typeAn external service dependency has drifted. Fix its start type
69The service is stopped. Service name: variableA dependency the sensor needs is not running
84Set Microsoft Defender Antivirus running mode. Force passive mode: variable, result code: variableNormal. This is the active or passive decision being applied
1806CSP: Get Onboarding State value complete. Result, IsDefaultThe MDM channel reading the onboarding state
1810CSP: Onboarding process. StartedThe MDM-driven onboarding flow beginning
1812CSP: Onboarding process. Write Onboarding blob complete. ResultThe blob reached the registry
1813CSP: Onboarding process. The service started successfullyThe sensor was started as part of the flow
1831CSP: Get Sense is running. Service is configured as delay-start, and hasn't started yetThe documented false negative behind non-compliance case 2

There is a second, separate event surface if you onboarded with a script rather than a policy. It is not in the SENSE channel at all. Microsoft directs you to Event Viewer, then Windows LogsApplication, filtered to the source below.

Windows Logs › Application, event source: WDATPOnboarding
Event IDDocumented error typeDocumented resolution
5Offboarding data was found but couldn't be deletedCheck permissions on the Policies key
10Onboarding data couldn't be written to registryCheck permissions on the Policies key, and confirm the script ran as administrator
15Failed to start SENSE serviceCheck that sc query sense is not in a pending state. Error 577 or 1058 means the antivirus ELAM driver is disabled. It can also mean the SENSE Feature on Demand is not installed
30The script failed to wait for the service to start runningReview the SENSE Operational channel
35The script failed to find needed onboarding status registry valueCheck the Status key manually
40SENSE service onboarding status isn't set to 1The service failed to onboard properly. Review the SENSE Operational channel
65Insufficient privilegesRun the script again with administrator privileges
70Offboarding script is for a different organizationGet an offboarding script for the correct organization

The antivirus side has its own channel again, distinct from both of the above. It sits under Applications and Services LogsMicrosoftWindowsWindows DefenderOperational.

Microsoft-Windows-Windows Defender/Operational
Event IDSymbolic nameWhat it proves
1150MALWAREPROTECTION_SERVICE_HEALTHYThe antivirus client is up and running in a healthy state. Reported hourly
1151MALWAREPROTECTION_SERVICE_HEALTH_REPORTFull health report, including real-time protection and behaviour monitoring state
2000MALWAREPROTECTION_SIGNATURE_UPDATEDSignatures updated successfully. Absence on a new device is a first-boot symptom
2001MALWAREPROTECTION_SIGNATURE_UPDATE_FAILEDThe security intelligence update failed

Check 5, and the two portal checks

Microsoft's documented end-to-end confirmation is a detection test, which produces a real alert rather than a status field. After onboarding, "you can choose to run a detection test to verify that a device is properly onboarded to the service". That is the only check that exercises the whole chain.

On the tenant side there are exactly two places to look. First, the Intune view of onboarding status.

intune.microsoft.comEndpoint security › Endpoint detection and responseEDR Onboarding Status

Microsoft describes the success indicators there as devices appearing in the Defender portal device inventory, an EDR Onboarding Status of "Successfully onboarded", and risk levels appearing in device compliance reports. Reading that tab needs Read permission for Microsoft Defender Advanced Threat Protection in Intune role-based access control, which is why some admins have never seen it populated.

Tip: build your Autopilot audit around the EDR Onboarding Status tab, because it is the only tenant-side view that answers "enrolled but not onboarded" as a single question. Pair it with the per-policy view at Endpoint securityEndpoint detection and response › your policy › Device status, which tells you whether the policy even reached the device.

The fix: connector first, then policy, then assignment

Order matters here. Creating the policy before the connector produces a policy that cannot use the automatic package, and nothing in the interface explains why.

Step 1: confirm or create the connector

  1. Sign in to the Microsoft Intune admin center and select Endpoint security then Defender for Endpoint.
  2. Read Connection status. If it shows Enabled, the services are already connected and you can skip to step 2. If it shows Unavailable, continue.
  3. Scroll to the bottom of the Defender for Endpoint page and select Open the Defender Security Center. If you are already connected, that link instead reads Open the Defender for Endpoint admin console.
  4. In the Microsoft Defender portal, go to System then Settings then Endpoints then General then Advanced features.
  5. Find Intune connection, toggle it to On, then select Save preferences.
  6. Return to Intune. Connection status should now show Enabled. Microsoft notes it can take up to 15 minutes to update.
security.microsoft.comSystem › Settings › EndpointsGeneral › Advanced featuresIntune connection

While you are on the Intune Defender for Endpoint page, also set Connect Windows devices to Defender for Endpoint to On under Compliance policy evaluation. Microsoft warns that enabling it connects all applicable devices you currently manage, plus future enrollments, for compliance evaluation. Do that deliberately, not by accident.

Step 2: create the Endpoint detection and response policy

intune.microsoft.comEndpoint securityEndpoint detection and responseSummary › Create Policy
  1. Go to Endpoint security then Endpoint detection and response then the Summary tab, and select Create Policy.
  2. Set Platform to Windows and Profile to Endpoint detection and response. Select Create.
  3. Enter a descriptive name and select Next.
  4. For Microsoft Defender for Endpoint client configuration package type, choose Auto from connector. Microsoft marks this as recommended because it uses the automatic onboarding package. The Onboard option, where you paste the blob content yourself, is documented as being for disconnected environments.
  5. Set Sample Sharing to All or None. Microsoft notes that None can reduce detection capabilities.
  6. Leave Telemetry Reporting Frequency alone. Microsoft states it is deprecated and does not affect new devices, and remains visible only for older policy compatibility.
  7. Add scope tags if you use them, then select Next.
  8. On Assignments, choose device groups. Microsoft is explicit about the difference: device groups are recommended for immediate deployment, while user groups require user sign-in before the policy applies.
  9. Review + create.

Step 8 is the one that quietly creates enrolled-but-unprotected devices in an Autopilot fleet. A user-group assignment cannot apply until somebody signs in, and a device that is provisioned, shelved, and later handed to a different person may never receive it.

Context: if you want broad coverage and no granularity, Microsoft publishes a quick path. Go to Endpoint security then Endpoint detection and response then the EDR Onboarding Status tab, and select Deploy preconfigured policy. It applies the automatic onboarding package, the default scope tag, and an assignment to All Devices, with no further configuration. You can edit the policy details afterwards, but not the initial deployment settings.

The Group Policy and local script routes

Autopilot-provisioned, Entra-joined clients have no Group Policy to receive, so this is not the route for them. It matters anyway, because most estates are mixed, and because the mechanism shows what the Intune policy is doing under the covers. Microsoft's Group Policy onboarding article is scoped to Windows Servers, and it works by running the onboarding script as an immediate scheduled task.

  1. Download the Group Policy configuration package from the Microsoft Defender portal at System then Settings then Endpoints then Device management then Onboarding, with Deployment method set to Group policy.
  2. Extract it to a shared, read-only location. You should have a folder called OptionalParamsPolicy and the file WindowsDefenderATPOnboardingScript.cmd.
  3. In the Group Policy Management Editor, go to Computer configuration then Preferences then Control panel settings.
  4. Right-click Scheduled tasks, point to New, then select Immediate Task (At least Windows 7).
  5. On the General tab, under Security options, select Change User or Group, type SYSTEM, then Check Names and OK.
  6. Select Run whether user is logged on or not and tick Run with highest privileges.
  7. On the Actions tab, add a Start a program action pointing at the UNC path of the shared WindowsDefenderATPOnboardingScript.cmd, using the file server's fully qualified domain name.
  8. Link the Group Policy Object to the target organisational unit.

Sample collection on that route is an administrative template rather than a registry edit. Copy AtpConfiguration.admx into C:\Windows\PolicyDefinitions and AtpConfiguration.adml into C:\Windows\PolicyDefinitions\en-US, or the equivalent central store paths, then find the setting at Computer Configuration then Policies then Administrative templates then Windows components then Windows Defender ATP. Microsoft notes that if you do not set a value, the default is to enable sample collection.

For one-off testing there is the local script. Microsoft is firm about its scope: "You should use it on a limited number of devices only (10 devices or less)." Download GatewayWindowsDefenderATPOnboardingPackage.zip, extract WindowsDefenderATPLocalOnboardingScript.cmd, and run it from an elevated command prompt. Microsoft also lists this as the last-resort diagnostic when Intune onboarding will not work: "If none of the event logs and troubleshooting steps work, download the Local script from the Device management section of the portal, and run it in an elevated command prompt."

Gotcha: there is also a custom configuration profile route using the CSP directly, with OMA-URI ./Device/Vendor/MSFT/WindowsAdvancedThreatProtection/Onboarding. It works, but the health-state nodes on the same CSP are read-only, and Microsoft says so twice. "The Health Status for onboarded devices policy uses read-only properties and can't be remediated", and a documented Intune error cause is "An attempt to remediate by read-only property". If you built something that tries to set SenseIsRunning, OnboardingState or OrgId, that is your bug.

Proof it worked: what a genuinely onboarded device looks like

The companion script collects every surface above in one pass and refuses to give a verdict when a check could not be completed. Below is a real run on a healthy device, trimmed for length, with the device name redacted.

PowerShell — Get-DefenderOnboardingState.ps1 (run elevated)
Microsoft Defender for Endpoint - local onboarding state ================================================================== Device : CONTOSO-1234 Elevated : True 1. Sensor surface ------------------------------------------------------------------ Sense service : Running Sense start mode : Auto # Running is the signal. Microsoft's own check for this is "sc query sense". 2. Onboarding state (written by the SENSE service) ------------------------------------------------------------------ OnboardingState : 1 (ONBOARDED) Org ID : present (value intentionally not printed) # 1 plus an org ID is the only combination that means protected. 3. Policy surface (written by Intune, Group Policy, or the local script) ------------------------------------------------------------------ Onboarding blob : present (content not printed) Offboarding blob : not present (good) AllowSampleCollection : 0 # An offboarding blob here would be the policy collision Microsoft warns about. 4. Microsoft Defender Antivirus mode (separate from EDR onboarding) ------------------------------------------------------------------ AMRunningMode : Normal IsTamperProtected : True Reading: Defender Antivirus is the active antivirus on this device. # Normal, Passive and EDR Block Mode are the three documented enabled values. Verdict ------------------------------------------------------------------ Onboarded, sensor running, no documented problem signals found. Result: ONBOARDED.

The verdicts the script distinguishes are the point of the whole exercise.

VerdictSignal combinationWhat to do
ONBOARDEDOnboardingState 1, org ID present, Sense running, no failure eventsNothing. Confirm in the Defender portal device inventory
ONBOARDED-BUT-NOT-REPORTINGOnboardingState 1, org ID present, Sense not runningOnboarding succeeded but nothing is being sent. Check the delayed-start case and events 68 and 69
NOT ONBOARDEDStatus key or OnboardingState missing, or OnboardingState 0Look at the policy, not the sensor. Then look at events 18 and 19
INCONCLUSIVEA check could not be completed, or the script is not elevatedFix the read, then re-run. A clean result on a failed read is worse than no result
NO SENSOR SURFACENo Sense service and no Windows Advanced Threat Protection keyUnsupported edition, or the SENSE Feature on Demand is not installed

To audit a whole Autopilot fleet rather than one device, run the script as an Intune remediation detection script. It exits 0 only for a genuinely onboarded device. It exits 1 for not-onboarded, onboarded-but-not-reporting and inconclusive, and exits 2 when the sensor surface is absent entirely. Cross-reference the non-zero results against the EDR Onboarding Status tab, and the difference between the two lists is your real exposure.

intune.microsoft.comEndpoint security › Endpoint detection and responseyour policyDevice status

One closing note on scope, because onboarding is not a small switch. Microsoft states that "onboarding to Defender for Endpoint will onboard the device to Data Loss Prevention (DLP), which is also a part of Microsoft 365 compliance". Offboarding is not small either: it "causes the device to stop sending sensor data to Defender for Endpoint, but data from the device, including references to any alerts it has, is retained for up to 6 months".

References

Microsoft official documentation:

Community deep dives, each fetched and confirmed on topic before citing:

AuthorArticleWhy it is worth reading
Mattias Melkersen, Rudy Ooms and Ben Whitmore (MSEndpointMgr)Onboarding modern with Autopilot: Magic trick revealedWalks the whole Autopilot provisioning sequence phase by phase, and places Defender onboarding in its actual position within the Device Setup order rather than treating it as a standalone task
Peter van der WoudeOnboard Windows 10 devices for Windows Defender Advanced Threat ProtectionThe original OMA-URI onboarding walkthrough with registry verification. Dated 2017 and uses the old product name, so read it for the mechanism rather than the interface

The companion script for this post is Get-DefenderOnboardingState.ps1. It is read-only, runs on Windows PowerShell 5.1 and PowerShell 7, prompts before installing anything, and never prints your org ID.

PowerShell — companion script

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-DefenderOnboardingState.ps1 — Reports whether this device is actually onboarded to Microsoft Defender for
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
You Deleted It From Intune and It Still Cannot Re-Enrol:…
A retired Autopilot device is three separate records: the Autopilot registration, the…
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
The Clock Is the First Dependency: How Time Skew Breaks…
Kerberos and OAuth both authenticate with timestamps, so a device with a dead CMOS…