Share via

Debug logon loop for windows 2025 RDS server on-premise in workgroup, using Azure ARC enabled server and AADLogin extension version 2.2.0

dummys 45 Reputation points
2026-03-18T13:36:11.55+00:00

Hello, I have a strange issue on connecting using AAD login to the RDP server that has a system-assigned managed identity and the AADLogin extension installed successfully. The user has the Virtual Machine Local User Login role, using mstsc.exe and select the "use a web account to sign in to the remote computer" checkbox, the user is also member on the server of the group: Hybrid agent extension applications. I use the logon like this: ******@mydomain.xx and I get the following error and a logon loop that always goes back to the logon page from ms365: Logon failure. Status: 0xC0000022 Correlation ID: an id

Inside azure sign-in audit on the user I get this:

Password Pass-through Authentication; PTA AgentId: ID true User approved

So for me the logon from AzureAD is successfull. I need help to debug further. thanks

Azure Arc
Azure Arc

A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.

0 comments No comments

Answer accepted by question author
  1. Suchitra Suregaunkar 11,150 Reputation points Microsoft External Staff Moderator
    2026-03-19T01:03:00.6833333+00:00

    Hello dummys It looks like your Azure AD authentication (PTA) is working but the RDP session is getting stuck in a logon loop with 0xC0000022, which usually means the AADLoginForWindows extension or local validation isn’t authorizing the user on the server side. Let’s walk through some targeted debugging steps:

    1. Verify the AADLoginForWindows extension completed successfully: • On the RDS host, open C:\WindowsAzure\Logs\Plugins\Microsoft.Azure.ActiveDirectory.AADLoginForWindows\2.2.0\CommandExecution.log and look for any ERROR or WARNING entries during install or startup. • If you see repeated restarts or failure messages, note the timestamp and full error.
    2. Check the device’s Azure AD join and PRT status: • On the server, run from an elevated prompt: dsregcmd /status • Ensure under “Device State”: – AzureAdJoined : YES – AzureAdPrt : YES • If either is NO, the extension didn’t finish the join – share that output.
    3. Test the local managed-identity endpoints : • In an elevated PowerShell on the server run: curl.exe -H Metadata:true "http://localhost:40342/metadata/identity/info?api-version=2018-02-01" curl.exe -H Metadata:true "http://localhost:40342/metadata/identity/oauth2/token?resource=urn:ms-drs:enterpriseregistration.windows.net&api-version=2018-02-01" • You should get JSON back for the identity info and a valid access token. If not, the hybrid IMDS service isn’t reachable or running.
    4. Validate network connectivity to Azure AD endpoints: • From the server: curl https://login.microsoftonline.com/ -D - curl https://enterpriseregistration.windows.net/ -D - curl https://pas.windows.net/ -D - • All should return at least a 200 or 404 (per docs). If you see DNS or timeout errors, update your DNS or proxy settings.
    5. Confirm required local policy for PKU2U auth : • On both server and client, open secpol.msc → Security Settings → Local Policies → Security Options → “Network security: Allow PKU2U authentication requests to this computer to use online identities” → set to Enabled. • Reboot or gpupdate /force after changing.
    6. Review the AAD operational event log : • On the server look under Event Viewer → Applications and Services Logs → Microsoft → Windows → AAD → Operational. • Find the logon attempt entries—any error codes or messages here can pinpoint why the extension is declining the session.
    7. Check Azure RBAC role assignment: • Verify that the user is assigned the built-in “Virtual Machine User Login” (or “Virtual Machine Administrator Login” if you need admin rights) role under your Arc-enabled server’s Access control (IAM).
      • The “Virtual Machine Local User Login” role you mentioned isn’t one of the documented built-in roles for AADLoginForWindows, so please double-check the exact role name.
    8. Try the alternate RDP user format (if client is only registered) : • If your client is Azure AD registered (not joined), you must connect as AzureAD[******@domain.com](******@domain.com) rather than just ******@domain.com.

    Follow-up questions/logs to gather next:

    • Paste the full dsregcmd /status output from both server and client.

    • Share any ERROR-level entries from CommandExecution.log around your last sign-in attempt.
    • Capture a screenshot or log of the AAD Operational events for that RDP session.

    • Confirm the exact Azure RBAC role name and show its assignment on the server’s IAM blade.

    References

    1. Resolve Microsoft Entra login extension issues https://docs.microsoft.com/azure/virtual-machines/extensions/azure-ad-login#resolve-azure-active-directory-login-extension-issues
    2. Sign in to an Azure Arc-enabled server using Microsoft Entra ID and Azure RBAC https://docs.microsoft.com/entra/identity/devices/howto-arc-sign-in-windows#troubleshoot-deployment-problems
    3. Troubleshoot sign-in problems (RDP via Azure AD) https://docs.microsoft.com/entra/identity/devices/howto-arc-sign-in-windows#troubleshoot-sign-in-problems

    Thanks,

    Suchitra.


1 additional answer

Sort by: Most helpful
  1. Mike James 0 Reputation points
    2026-03-24T17:13:38.5766667+00:00

    I also experienced this issue and it was resolved by the recent KB5085516 released on 21st March.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.