Hello there,
If the onboarding is completed successfully but the devices aren't showing up in the Devices list after an hour check the result of the script on the device:
Click Start, type Event Viewer, and press Enter.
Go to Windows Logs > Application.
Look for an event from WDATPOnboarding event source.
If the script fails and the event is an error, you can check the event ID in the following table to help you troubleshoot the issue. https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/troubleshoot-onboarding?view=o365-worldwide#troubleshoot-onboarding-when-deploying-with-a-script
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer–