About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
Onboarding is the step that connects a Windows device to a Microsoft Defender for Endpoint tenant: the device is given onboarding settings by a script or a management tool, and the Defender for Endpoint service reads them when it starts. Two events in the service's own log say that did not happen. Event 6 reads "Microsoft Defender for Endpoint service isn't onboarded and no onboarding parameters were found." Event 7 reads "Microsoft Defender for Endpoint service failed to read the onboarding parameters." A device that logs either one is not reporting to the Microsoft Defender portal.
What follows explains what Microsoft says the two events mean, how to tell which deployment step failed, and the fix Microsoft documents. Nothing before the Fix section changes anything.
What the error means
The events are in the SENSE Operational log: in Event Viewer, Applications and Services Logs > Microsoft > Windows > SENSE > Operational. Microsoft describes SENSE as "the internal name used to refer to the behavioral sensor that powers Microsoft Defender for Endpoint."
On Microsoft's event reference page, event 6 is described as "The device didn't onboard correctly and isn't reporting to the portal. Onboarding must be run before starting the service." Its action is "Check that the onboarding settings and scripts were deployed properly. Try to redeploy the configuration packages." Event 7 has the same description and action. The message of event 7 on that page ends "Failure: variable", and the page explains that the variable is a "detailed error description".
Microsoft's onboarding troubleshooting page prints the two messages slightly differently. There, event 6 ends "Failure code: variable" and event 7 reads "failed to read the onboarding parameters. Failure code: variable". Microsoft does not explain the difference, so read the actual text in your own log. For event 6 the resolution on that page is "Run the onboarding script again", and for event 7 it is "Ensure the device has Internet access, then run the entire onboarding process again."
Two other facts shape the diagnosis. First, event numbers repeat in different logs: the onboarding script writes its own events under the source WDATPOnboarding in the Application log, and Microsoft says those IDs "are specific to the onboarding script only". Second, a device that is onboarded can still take time to show up. Microsoft's event 11, "Onboarding or reonboarding of Defender for Endpoint service completed.", carries the note "It might take several hours for the device to appear in the portal." The onboarding troubleshooting page uses a shorter test, saying that a device missing from the Devices list "after an hour" may indicate an onboarding or connectivity problem.
Likely causes
Microsoft does not rank causes for these two events. Its pages give these places to look:
| Place | What Microsoft says | Where to look |
|---|---|---|
| The deployment itself | The device "didn't onboard correctly"; check that "the onboarding settings and scripts were deployed properly" | The Group Policy, Configuration Manager or Intune deployment |
| The onboarding script | With Group Policy, the console "doesn't indicate if the deployment has succeeded or not", so the script's own output on the device is the record to read | The Application log, source WDATPOnboarding |
| Registry permissions or a missing registry key | The script's events 5 and 10 point to permissions on HKLM\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection; Microsoft's Intune table lists the cause "Microsoft Defender for Endpoint Policy registry key doesn't exist or the OMA DM client doesn't have permissions to write to it" | The policy registry key |
| A damaged or mismatched package | Microsoft's Intune table lists, against error 0x87D1FDE8, the cause "Onboarding or offboarding failed on a wrong blob: wrong signature or missing PreviousOrgIds fields." Microsoft also says repackaging the installation package "is not a supported scenario" | The package as downloaded from the portal |
| Both onboarding and offboarding deployed | For non-compliant Intune devices: "Ensure that Onboarding and Offboarding policies aren't deployed on the same device at same time." | The Intune policy assignments |
| A new device that has not finished first start | Event 19, "OOBE (Windows Welcome) hasn't yet completed.", and the matching note that the service starts only after Windows updates finish installing | The device's first-start state |
Prove the cause before changing anything
Everything here reads only.
-
In the SENSE Operational log, choose Filter Current Log in the Action pane, tick Critical, Warning and Error, and click OK. Write down which events appear, with their times, and whether event 6 or 7 comes first. Look also for event 19, which would point to a device that has not finished its first start. Microsoft notes that logon after first start is no longer required for the service to start on Windows 10 version 1809 or later and Windows Server 2019 or later.
-
If the device was onboarded by a script, open the Application log and look for events from the source WDATPOnboarding. Microsoft's table lists the script's own events, and the ones that explain events 6 and 7 are these: 10, "Onboarding data couldn't be written to registry", with the advice to check registry permissions and verify the script ran as an administrator; 35 and 40, which concern the status value the service writes the first time it starts; and 65, "Insufficient privileges", with the advice to "Run the script again with administrator privileges".
-
Check the state of the service. Microsoft's page names this command for service health:
sc query sense
Microsoft says to make sure the service is not in an intermediate state such as Pending_Stopped or Pending_Running.
-
For Microsoft Intune deployments, read the MDM event log named Microsoft\Windows\DeviceManagement-EnterpriseDiagnostics-Provider, channel Admin. Event 1819 in that log is described as a failure of the Microsoft Defender for Endpoint CSP to set a node's value. Microsoft's page says the troubleshooting step for it is to download the Cumulative Update for Windows 10, version 1607, so it applies to that older version. Also read the Intune error code for the policy, if there is one; Microsoft's table lists 0x87D1FDE8 (-2016281112), "Remediation failed", against the Onboarding and Offboarding OMA-URIs.
-
For a Group Policy deployment, read the output of the onboarding script on the device, because the Group Policy console shows nothing about success.
Example (illustrative): at contoso.com.au a laptop was onboarded by a Group Policy that runs the script, and 90 minutes later it is absent from the Devices list. The SENSE Operational log shows event 6. The Application log has a WDATPOnboarding event 65, "Insufficient privileges". That matches Microsoft's advice for event 65, which is to run the script again with administrator privileges.
Fix
Microsoft's guidance for both events is to redeploy or run the onboarding again, with the packages and settings checked first. The fix has two parts: correct the cause the proof found, then run onboarding again.
Correct the cause
Description of the vendor's guidance, not a step for every device:
- For an Intune deployment with both Onboarding and Offboarding policies on one device, Microsoft says to make sure they are not deployed at the same time. That is a change to the management tool's policy assignments, and it is described here, not scripted.
- For a policy registry key that is missing, Microsoft's Intune table says: "Ensure that the following registry key exists: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection" and, if it doesn't, to "open an elevated command and add the key". The page gives no command for creating it.
- For a package that was changed, Microsoft says repackaging the installation package is not a supported scenario, and it "can negatively impact the integrity of the product". Download a fresh package from the Microsoft Defender portal under System > Settings > Endpoints, then Onboarding under Device management.
Run the onboarding script again
Use this on a device where the script is the deployment method. Microsoft lists Local script (up to 10 devices) as one method for Windows 11 and Windows 10 devices, alongside Intune, Configuration Manager, Group Policy and VDI scripts.
Before you run it, record the state you will compare with afterwards: run sc query sense and write down the result, and note whether the registry key HKLM\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection exists. The page gives no command to export that key, so the record is a note.
Risk: the next step runs the onboarding script, which connects the device to the Defender for Endpoint tenant that the downloaded package belongs to. Use a package from your own organisation's portal. Microsoft gives no way to undo the script itself; the route back is offboarding, which uses a separate offboarding package that Microsoft says expires seven days after it is downloaded.
Microsoft says to run the downloaded local script in an elevated command prompt. Run the onboarding script again from the package you downloaded, in an elevated command prompt. For event 7, make sure the device has Internet access first, as Microsoft says, and run the entire onboarding process again.
Only if you need to reverse this change: offboarding changes the device's onboarding state, so the device stops being onboarded to the tenant. The script has no reversal of its own, as the warning above says. The route back is offboarding with your organisation's offboarding package from the portal, and Microsoft's pages used here give no command for it.
Redeploy through the management tool
For a Group Policy or Configuration Manager deployment, Microsoft's guidance is to redeploy the configuration package after fixing the cause. Microsoft notes that in Configuration Manager version 1606 (July 2016) or later you are no longer required to onboard devices with a local script and can deploy the onboarding configuration files instead.
Confirm the fix
- The SENSE Operational log shows event 11, "Onboarding or reonboarding of Defender for Endpoint service completed." Microsoft lists it as a normal operating notification.
- Events 6 and 7 do not return the next time the service starts.
- The device appears in the Devices list. Allow the several hours Microsoft names under event 11 before treating its absence as a failure.
What to watch afterwards
- New devices from an image or build process. Microsoft's guidance for newly built devices is that the service does not start automatically if first start has not finished, on versions before those that removed the requirement.
- Intune policies. Check that Onboarding and Offboarding policies are never both assigned to the same device.
- Expiring offboarding packages. Microsoft says they expire seven days after download and that expired packages sent to a device are rejected.
- Events 9, 10 and 25 to 27 in the same log, which Microsoft's table describes as the device not onboarding correctly, if events 6 and 7 are replaced by them.
Read next
Related articles you may want next.
- TroubleshootingGroup Policy Not Applying: gpresult, Events and SYSVOLA Group Policy setting missing on a hosted server: read gpresult as the affected user, check loopback, filter one run's events, then check SYSVOL state.Read article
- Troubleshooting"Windows failed to apply the MDM Policy settings" after gpupdate /force on an Intune-enrolled hybrid devicegpupdate /force warns Windows failed to apply the MDM Policy settings on an Intune device? Microsoft calls it expected when enrolled. How to prove it.Read article
- TroubleshootingWindows enrolment fails in Intune: error codes 8018000a, 80180014, 80180022, 80180026 and 8018002b explainedIntune enrolment fails with 8018000a, 80180014, 80180022, 80180026 or 8018002b? What each code means, how to prove it and the setting to change.Read article
Risks and limits
These steps have not been run or lab-tested.
Microsoft's two pages word events 6 and 7 differently, as described above, and give no version range. The "several hours" and "after an hour" figures come from two different pages and are not reconciled by Microsoft. Windows Server 2016 and Windows Server 2012 R2 onboard by a different route, with the Microsoft Monitoring Agent on older builds, and Microsoft's page for them lists separate checks. Event 1819 is tied by Microsoft to Windows 10, version 1607. The command to create a missing registry key is not given on the page, so it is left out.
Sources
- Review events and errors using Event Viewer — Microsoft Learn, page dated 2026-07-02, accessed 3 December 2026
- Troubleshoot Microsoft Defender for Endpoint onboarding issues — Microsoft Learn, page dated 2026-03-05, accessed 3 December 2026
- Onboard Windows client devices to Microsoft Defender for Endpoint — Microsoft Learn, page dated 2026-04-13, accessed 3 December 2026
- Troubleshoot subscription and portal access issues — Microsoft Learn, page dated 2026-06-15, accessed 3 December 2026
This article was originally published on .