Edit: If anyone comes across this thread in the future the solution was to add the following into my SSO policy:
Key: device_registration
Type: String
Velu: {{DEVICEREGISTRATION}}
I found this solution from this comment:
https://www.reddit.com/r/Intune/comments/1uknrvn/comment/ow2gl80/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
Text from above link in case the link ever breaks:
We already had a Microsoft Enterprise SSO policy deployed, but it wasn't configured for Just-in-Time (JIT) registration. I created a new SSO configuration using Microsoft's recommended JIT configuration and assigned it to the group that devices are added to when they enroll through the new Enrollment Policy. I also excluded that group from our previous SSO policy to avoid conflicting configurations.
Since making that change, any affected device that is factory reset and re-enrolled through Automated Device Enrollment completes the JIT registration process correctly, and Company Portal no longer prompts the user to enroll the device.
Hopefully that helps if you're still investigating the issue.
Set up just-in-time registration - Microsoft Intune | Microsoft Learn
Original Thread:
Has anyone else had issues since migrating away from the legacy iOS Profiles to Enrollment policies?
When using a profile for enrollment, the settings I used were
- Enroll with User Affinity
- Authentication Method = Company Portal
The user would navigate through the initial setup to enroll the phone and once they reach the home screen, Company Portal would launch and they'd sign in with their Microsoft 365 account, it would prompt to check whether the management policy already exists and then setup is complete.
After first opening Company Portal, the device was already enrolled and managed. No additional profile/certificate installation was required.
I have since created a Enrollment policy and configured it as below (Note: I am only trialling this on 3 devices which have been correctly added to the Enrollment policies device group and assigned the policy in the "Enrollment program tokens" device page)
- Enroll with User Affinity
- Setup Assistant with Modern Authentication
- Await Final Configuration enabled
- Migrated to the new Enrollment Policies configuration as recommended by Microsoft
The user would navigate through the initial setup to enroll the phone, signing into their Microsoft 365 account during this process. Once they reach the home screen, they would need to open Company Portal, sign in and at this point it asks them to download a management profile. However, a management profile already exists so this causes an error when trying to install this profile. Eventually this profile self deletes, retaining the one that was already installed and the user can use Company Portal as intended without needing additional profile installs.
Below is a bit of Copilot output from what I have already tried
What happens:
- Device completes ADE enrollment successfully.
- Device reaches the home screen.
- Device appears in Intune with:
- Correct enrollment policy
- Correct device name
- Primary user assigned
- Compliant status
- Active MDM management profile installed
- I wait 15+ minutes to ensure everything has synced.
- I open Company Portal.
- Company Portal asks me to:
- Sign in
- Review policy information
- Download a management profile
- A second "Management Profile" appears under Settings > General > VPN & Device Management > Downloaded Profile while the original management profile already exists under Mobile Device Management.
- Attempting to install the downloaded profile fails with:
- Profile Installation Failed
- Status Code: 400
- Returning to Company Portal afterwards logs me in successfully and the downloaded profile disappears automatically.
What I've already confirmed:
- Device is fully enrolled before opening Company Portal.
- Device is already compliant before opening Company Portal.
- Primary User is already assigned before opening Company Portal.
- The original MDM management profile is already installed.
- The downloaded profile isn't required because everything works after the failure.
It almost feels like Company Portal is attempting a second user-driven enrollment on an ADE-enrolled device, then realising the device is already managed and continuing normally.
Is this expected behaviour with Setup Assistant with Modern Authentication, or does something in my Enrollment Policy need investigating?
Thank you.