Platform compatibility
Prerequisites
- An admin account in the cockpit
- If you use an EDR: an exclusion for the agent (see EDR exclusions (Windows) in Read before you start)
- To change the MDM scopes in Entra: a Microsoft account with the Global Administrator role on your Entra tenant, and a licence that includes Microsoft Entra ID P1 or P2. Microsoft lists automatic MDM enrollment as a premium Entra feature
- The
{company}subdomain of your MDM address ({company}.mdm.getprimo.com). Contact support if you don’t know it
Read before you start
A Windows device has one MDM (Microsoft Learn: MDM overview). Microsoft Learn documents no procedure to move an Entra joined device from Intune to another MDM, and no effect of an MDM scope change on devices already enrolled in Intune. Run the whole procedure on one device you own before you move the others.
Migrate with the agent
With Automatic MDM migration on, the Primo agent unenrolls the device from Intune, then enrolls it in Primo with the Fleet discovery URL, without going through Entra. The Entra MDM scope isn’t needed for this method.1
Turn on Automatic MDM migration
In the cockpit, go to MDM > Settings. In the Enrollment section, turn on Automatic MDM migration. It’s off by default.
With it on, the Primo agent on a Windows device enrolled in another MDM unenrolls the device from that MDM, then enrolls it in Primo. This applies to every device that has the agent and is enrolled in another MDM. See MDM settings.To also set the Intune MDM scope to

None as a precaution, see Move the device with a script. This is the guidance of the Primo cockpit: Microsoft doesn’t document what a scope change does to devices already enrolled.2
Deploy the agent through Intune
Deploy the Primo agent to the devices you want to move, as a silent install through Intune. See Silent agent deployment for where to download the package.A device appears in the cockpit with the status On in another MDM once the agent is installed. Without the agent, the cockpit doesn’t see that the device is managed elsewhere.If you deploy a generic installer, the cockpit may not know whose device it is. See Use assignment suggestion.
3
Check the status
In the cockpit, the device status goes from On in another MDM to On. See Check the migration.
Check the migration
- In the cockpit, the device’s MDM status changes from On in another MDM to On.
-
On the device, the active enrollment’s
DiscoveryServiceFullURLis your Fleet discovery URL,https://{company}.mdm.getprimo.com/api/mdm/microsoft/discovery. To list the values, run: - If a device stays on On in another MDM or goes back to Intune, see Troubleshoot a device that stays on in another MDM.
Move your Intune policies to Primo
The settings that Intune applies are defined in Intune. To keep them after the move, recreate them in Primo before you move the devices. Microsoft documents that when Intune retires a device, the settings set by Intune policy are no longer enforced and users can change them (Microsoft Learn: Retire). Learn doesn’t document this for a device that leaves Intune through the agent, so check it on a pilot device.- List what to recreate. In the Intune admin center, go to Devices > Manage devices > Configuration. You can export a Settings catalog policy as JSON to read its settings (Microsoft Learn: Settings catalog).
- Look for a Primo control first. See the available controls.
- For a Windows setting that no control covers, use CSP Builder and the Custom file control. The Windows settings of the Settings catalog are generated from the Windows CSPs, and the Learn more link in a setting’s tooltip opens its CSP (Microsoft Learn: Settings catalog). Find the same setting in the Policy CSP catalog of CSP Builder, set its value, and load the file on the Custom file control. See Custom file.
Troubleshoot a device that stays on in another MDM
If a device keeps the status On in another MDM after the migration, check these points:- Automatic MDM migration is on in MDM > Settings.
- The agent is installed and communicating. Without it, the cockpit can’t migrate the device.
- The device isn’t a Windows Server. The agent doesn’t unenroll Windows Server devices.
- The agent spaces its attempts, so allow some time before you decide a device is stuck.
- The Intune scope is
None(or a group that doesn’t include the user), so the device doesn’t go back to Intune.
Move the device with a script
If the checks above don’t fix it, run the migration script on the device. The script goes through Entra automatic enrollment, so it needs what the agent method doesn’t: the Fleet application and the MDM scopes in Entra. Microsoft doesn’t document thedeviceenroller.exe command the script uses, so test it on a pilot device.
1
Open Mobility (MDM and WIP)
In the Entra admin center, go to Mobility (MDM and WIP). The list shows the applications that can enroll devices. You need Fleet and Microsoft Intune in it.

2
Create the Fleet application if it's missing
The Fleet application is what tells Entra to send automatic enrollment to Primo. It holds the terms of use and discovery URLs of your MDM. Without it, the script can’t enroll a device in Primo. If your devices come from Intune, you probably haven’t created it yet:
- Click + Add application > + Create your own application, enter
Fleetas the name, and click Create. - Set MDM terms of use URL to
https://{company}.mdm.getprimo.com/api/mdm/microsoft/tosand MDM discovery URL tohttps://{company}.mdm.getprimo.com/api/mdm/microsoft/discovery, then save. - Set the Application ID URI and the API permissions. The details are in Create the Fleet application, in step 3 (Connect Azure and Fleet) of Set up zero-touch.
3
Set the Intune MDM scope to None
Click Microsoft Intune, set MDM user scope and WIP user scope to 
To move devices in batches, set the Intune MDM user scope to
None, and click Save. We recommend it, so that a device doesn’t go back to Intune: this is the guidance of the Primo cockpit, and Microsoft doesn’t document what a scope change does to devices already enrolled.
Some and select a group instead of None.4
Set the Fleet MDM scope
Click Fleet, set MDM user scope to
All, and click Save. To move devices in batches, set Fleet to Some with the group you move.Only one MDM can have the All scope: Microsoft requires that no user belongs to more than one selected group and that no other application is set to All (Microsoft Learn: Mobility scopes).5
Run the script
The script removes the enrollment of your previous MDM from the Windows registry, then triggers a new enrollment. Replace
Run the script on one device first, your own. Then move the others one by one, or all at once with a policy.
INPUT_URL_HERE with the discovery URL of your previous MDM. To find it, read the DiscoveryServiceFullURL value under HKLM:\SOFTWARE\Microsoft\Enrollments\ on a device enrolled in Intune.Migration script (PowerShell)
Migration script (PowerShell)
6
Run the script with a policy
For many devices, use a policy in the Fleet console. Upload the script to Controls > Scripts, create a policy with the query below, and link the script to it.The policy passes when the device has no enrollment left with another discovery URL, and fails when it still has one. Fleet runs the linked script when the policy fails on a device: the first time it fails, and each time it goes from passing to failing.
Policy query for batch migration
Policy query for batch migration
Replace
{company} with your subdomain:If you also use Autopilot
Autopilot is a separate job from the migration. It applies to new or reset devices. Microsoft downloads the Autopilot profile when a device first starts and doesn’t replay it on a device that is already provisioned (Microsoft Learn: Autopilot FAQ).- Zero-touch needs the Fleet scope set to
All, as in Move the device with a script. The other steps (deployment profiles, device registration, testing) are in Zero-touch for Windows. That article has you create deployment profiles in Microsoft’s Intune admin center. This is the Autopilot service, not the MDM enrollment of your devices. - Don’t delete Autopilot devices or their Entra objects as part of the migration. Microsoft warns that deleted system-managed devices can’t be reprovisioned (Microsoft Learn: Stale devices).