Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

MDM enrolment error 0xcaa9001f on co-managed Windows devices: "Integrated Windows authentication supported only in federation flow"

Technical article
Troubleshooting

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.

When devices that are Microsoft Entra hybrid joined and managed by Configuration Manager fail to enrol in MDM, and CoManagementHandler.log says "Integrated Windows authentication supported only in federation flow", Microsoft's page names one cause: the Configuration Manager client tried integrated Windows authentication against Microsoft Entra ID while the verified domain is not federated. It gives two situations in which that happens, and one fix for both.

The page notes that enrolling a bring-your-own device or using Group Policy auto-enrolment works. That fits a fault on the Configuration Manager side rather than in Intune or the device itself.

What the error means

Microsoft's page is titled "MDM enrollment fails with error 0xcaa9001f for co-managed Windows devices". It lists three places the failure is recorded.

In %WinDir%\CCM\logs\CoManagementHandler.log:

MDM enrollment failed with error code 0xcaa9001f 'Integrated Windows authentication supported only in federation flow.'. Will retry in 15 minutes...

In Event Viewer, under Applications and Services Logs, Microsoft, Windows, DeviceManagement-Enterprise-Diagnostic-Provider, Admin:

  • System Migration Task Started.
  • Impersonation result. Result: (An attempt was made to reference a token that does not exist.).
  • Auto MDM Enroll: Failed (Unknown Win32 Error code: 0xcaa9001f)

And under Applications and Services Logs, Microsoft, Windows, Microsoft Entra ID, Operational:

  • Http request status: 400. Method: POST Endpoint Uri: https://login.microsoftonline.com/<AADTenantID>/oauth2/token
  • OAuth response error: invalid_grant
  • Error description: AADSTS70002: Error validating credentials. AADSTS50155: Device is not authenticated.

The page does not decode 0xcaa9001f beyond the message in CoManagementHandler.log.

Likely causes

The page's cause is: "This issue occurs when integrated Windows authentication is tried by the Configuration Manager client against Microsoft Entra ID while the verified domain isn't federated." It occurs in one of two situations:

Situation What to check
The Cloud Management Azure service is not configured in Configuration Manager In the console, Administration, Cloud Services, Azure Services: is there a Cloud Management connection?
Either AD User Discovery or Microsoft Entra user Discovery is not enabled for the affected users The page says both discovery methods must be enabled

Microsoft's Azure services page says that Cloud Management is the service that "enables the site and clients to authenticate by using Microsoft Entra ID". Among the scenarios it enables are installing and assigning clients using Microsoft Entra ID for authentication, and configuring Microsoft Entra user Discovery.

Prove the cause before changing anything

All of these only read.

  1. Confirm the message on an affected device in %WinDir%\CCM\logs\CoManagementHandler.log. The line in the page ends "Will retry in 15 minutes", so the log repeats.
  2. Confirm that Group Policy auto-enrolment or BYOD enrolment works for a comparable device. The page says they do for the devices that show this error. If neither works, the cause may be something else.
  3. In the Configuration Manager console, go to Administration, expand Cloud Services, and select the Azure Services node. Note whether a Cloud Management service exists. This is the node Microsoft's wizard page starts from.
  4. Check the discovery methods. Go to Administration, expand Hierarchy Configuration, and select the Discovery Methods node. Microsoft's discovery page says Active Directory User Discovery is "Enabled by default: No" and is configurable. See whether it is enabled, and whether the affected users are inside its containers.
  5. Check Microsoft Entra user Discovery. Microsoft's page on configuring discovery methods says it "isn't enabled or configured the same as other discovery methods" and is configured when you onboard the site to Microsoft Entra ID, and the Azure services wizard's Discovery page is where it is set for the Cloud Management service. Its actions are logged in SMS_AZUREAD_DISCOVERY_AGENT.log on the top-tier site server. The page lists the attributes it can find, among them objectId, displayName, mail, userPrincipalName, tenantID and onPremisesSecurityIdentifier, and says it supports full and delta synchronisation of user attributes from Microsoft Entra ID, so a user missing from the results is worth checking against those attributes.

Example (illustrative): at contoso.com.au, forty hybrid-joined laptops repeat the 0xcaa9001f line every 15 minutes. A test laptop enrols successfully by Group Policy. The Azure Services node in the console is empty, and Active Directory User Discovery is disabled. Both situations on the page apply.

Fix

The page's solution is one sentence: "configure Azure Services for Cloud Management, and make sure that both AD User Discovery and Microsoft Entra user Discovery are enabled for the users." It does not give the steps, which come from Microsoft's Configuration Manager pages. The steps below follow those pages. They change the Configuration Manager site, so agree them with the person who administers it and the Microsoft Entra administrator. Microsoft's wizard page says: "Have a discussion in advance with your Microsoft Entra administrator". It does so because the wizard uses Microsoft Entra apps, which can be created in advance and imported, or created by Configuration Manager.

Save the current state first. In the console, note what the Azure Services node shows and, in Discovery Methods, whether Active Directory User Discovery is enabled and its containers. Take a screenshot of each.

Risk: the next steps add a Cloud Management connection and enable discovery in Configuration Manager. They create or import Microsoft Entra apps, and discovery adds user data to the site. Both can affect other devices managed by this site, not only the ones with the error. Microsoft's wizard page also says that if a Microsoft Entra Conditional Access policy applies to "All Cloud apps", the Server Application must be excluded from that policy. The page does not describe the effect on devices that already enrol.

To configure Azure Services, as Microsoft's wizard page describes:

  1. In the Configuration Manager console, go to the Administration workspace, expand Cloud Services, and select the Azure Services node.
  2. On the Home tab of the ribbon, in the Azure Services group, select Configure Azure Services.
  3. On the Azure Services page, specify a Name, an optional Description, and select Cloud Management as the Azure service. Select Next.
  4. On the App page, select the Azure environment, then Browse, Import or Create for the web and native apps, as the page describes.
  5. On the Discovery page, configure Microsoft Entra user Discovery, then complete the Summary, Progress and Completion pages.

To enable Active Directory User Discovery, as Microsoft's page on configuring discovery methods describes:

  1. Go to Administration, expand Hierarchy Configuration, and select the Discovery Methods node.
  2. Select Active Directory User Discovery, then Properties on the Home tab of the ribbon.
  3. On the General tab, select the checkbox to enable discovery, and use the New icon to specify an Active Directory container that holds the affected users.

To undo it: for the Azure Services connection, select the service and choose Delete in the ribbon. Microsoft's wizard page says this "deletes the connection in Configuration Manager. It doesn't remove the app in Microsoft Entra ID", so ask your Azure administrator to delete a created app if it is no longer needed. For discovery, return to the same Properties window and clear the enable checkbox, and remove the container you added (the reverse of the step above; Microsoft's page does not word it this way).

Confirm the fix

  • CoManagementHandler.log on an affected device stops reporting 0xcaa9001f after its next 15-minute retry.
  • The device enrols; the page does not give a console check, so look for the device as co-managed in your usual views.
  • The Microsoft Entra ID Operational log no longer records AADSTS50155 "Device is not authenticated" for the device.
  • Users appear in Configuration Manager from both discovery methods. Microsoft's discovery page says Active Directory user discovery actions are logged in adusrdis.log in the <InstallationPath>\LOGS folder on the site server.

What to watch afterwards

  • The Microsoft Entra app's secret key. Microsoft's wizard page says that if you let the key expire, Configuration Manager "can't authenticate with Microsoft Entra ID, which will cause your connected Azure services to stop working", and that an imported app gives no console notification of its expiry date.
  • New users added to the domain after discovery runs. The page requires discovery for "the users", so check that new users fall inside the discovery scope.
  • Any device that still repeats the error after the next retry; that points back to a different cause.

Risks and limits

These steps have not been run or lab-tested.

Microsoft's co-management error page is short and does not say which Configuration Manager version it covers. The wizard and discovery steps come from separate Microsoft pages, and the wizard page states "Configuration Manager (current branch)"; the co-management error page names no other fix. It does not say how long devices take to enrol after the change. Configuring a cloud service for the site can affect every device the site manages, so change it with its administrator, not on one device.

Sources