I worked for an Organization that already had their devices already Entra-joined before I came on board. They wanted me to get these devices enrolled into Intune without wiping/resetting these devices.
In this article I will show you how I did just that!
The Process:
The process is actually pretty simple. Just run the below script for the device. Unfortunately (Or fortunately?) this has to be ran in system context.
The easiest way to do this is if your org has a way to push this out to all devices in phases rollouts via an RMM tool as that should have system rights by default.
You can also use PSExec to run the script under system context with or without an RMM tool.

# Set MDM Enrollment URL's
$key = 'SYSTEM\CurrentControlSet\Control\CloudDomainJoin\TenantInfo\*'
$keyinfo = Get-Item "HKLM:\$key"
$url = $keyinfo.name
$url = $url.Split("\")[-1]
$path = "HKLM:\SYSTEM\CurrentControlSet\Control\CloudDomainJoin\TenantInfo\\$url"
New-ItemProperty -LiteralPath $path -Name 'MdmEnrollmentUrl' -Value 'https://enrollment.manage.microsoft.com/enrollmentserver/discovery.svc' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath $path -Name 'MdmTermsOfUseUrl' -Value 'https://portal.manage.microsoft.com/TermsofUse.aspx' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath $path -Name 'MdmComplianceUrl' -Value 'https://portal.manage.microsoft.com/?portalAction=Compliance' -PropertyType String -Force -ea SilentlyContinue;
# Trigger AutoEnroll
C:\Windows\system32\deviceenroller.exe /c /AutoEnrollMDM
Results:
Once you run the powerscript, it will first check that your MDM URL/Tenant is accessible. Then it will attempt to enroll the device.
You will need to give it some time to register. Please be patient. I have seen it take anywhere between 10-30 minutes depending on the device.
Here is what you should see in Event Viewer. Look for an Event 76 - DeviceManagement-Enterprise-Diagnostic event log.


After some time of waiting you will notice event 75 with the message that Auto MDM Enroll: Succeeded

Conclusion:
I hope this helped you. If you have any errors or it takes longer than 24 hours to register a particular device, please post a comment and I am happy to help where I can.