How to Fix CAA50021 Error Code in Microsoft 365 Apps?

The Error CAA50021, Number of Retry Attempts Exceeds Expectations, occurs when attempting to log into Microsoft 365 applications. This error can appear in almost all Microsoft 365 applications and often occurs when a device fails to register in the Azure AD Admin Center during a user sign-in attempt.

This issue mainly arises when one of the services, Mobile Device Management for Microsoft 365 or Microsoft Intune, is not enabled from the Azure AD Admin Center. However, this may not always be the case, as other factors such as corrupted cache files and account problems could also trigger this error. Stay with us until the end to resolve error code CAA50021.

Before making any changes to your PC, ensure you are not connected to any VPN, as this could prevent logging into office applications. Additionally, consider restarting your system before proceeding with the solutions outlined below.

1. Link Your Device With Azure AD

If your device is not properly linked with Azure AD, follow these steps to check and ensure it is properly connected:

  1. Open Settings using the Win + I keys simultaneously.
  2. Navigate to Accounts from the left pane.
  3. Select Access Work or School.
  4. If you are already connected, click Disconnect and then reconnect. If not, click Connect and follow the instructions to link your account with Azure AD.
  5. If the problem persists, disconnect your account from the Access Work or School Settings, delete your device from the Azure AD Admin Center, and try again.

2. Allow Users to Register Their Devices with Azure AD

This step requires admin access. If you are not an admin, contact your admin to proceed. Users can usually register their devices with Azure AD if Mobile Device Management for Microsoft 365 or Microsoft Intune is enabled.

  1. Log in to the Azure AD Admin Center.
  2. Go to Devices > Device settings.
  3. Enable the option for users to register their devices with Azure AD and verify if the issue is resolved.

3. Re-register Your Device

If your device registration has expired, it needs to be re-registered. This action must be performed by an admin. If you are not an admin, please contact your admin.

  1. Press the Win + R keys simultaneously.
  2. Type cmd and press Enter to open the Command Prompt.
  3. Paste the following commands one by one, pressing Enter after each.
    dsregcmd /leave 
    dsregcmd /status

  4. Close the command prompt.
  5. Open the Start Menu and type Task Scheduler. Press Enter to open it.
  6. Expand Task Scheduler Library > Microsoft > Windows.
  7. Find and select Workplace Join. Then, click Enable, followed by Run.
  8. Restart your computer to see if the error has been resolved.

4. Repair the Office App

Repairing the application files of your Office application can resolve issues caused by corrupted files.

  1. Press the Win key and type Add or Remove Program.
  2. Press Enter to access the Apps & Features Settings.
  3. Locate the Office App, click the three dots, and select Advanced Options.
  4. Scroll to Reset and click Repair.
  5. If the error still occurs, consider resetting the app.

5. Clear the Microsoft Teams Cache

  1. Ensure Microsoft Teams is not running in the background.
  2. Press the Win + R keys and type %appdata%\Microsoft\Teams in the Run Window.
  3. Delete all files within the Microsoft\Teams folder to fix the error.

6. Reinstall the Office App

If the issue persists, consider reinstalling the Office app. This removes corrupted files that might cause the error.

  1. Press the Win + I keys to open Windows Settings.
  2. Go to Apps > Installed Apps.
  3. Find the Office App, click the Three Dots, and select Uninstall > Uninstall.
  4. After uninstallation, reinstall the app and check if the problem is resolved.

If the error continues, it may be necessary to contact Microsoft Office Support for further assistance.


Hamza Mohammad Anwar

Hamza Mohammad Anwar is an intermediate JavaScript web developer with a focus on developing high-performance applications using MERN technologies. His skill set includes expertise in ReactJS, MongoDB, Express NodeJS, and other related technologies. Hamza is also a Google IT Certified professional, which highlights his competence in IT support. As an avid problem-solver, he recreates errors on his computer to troubleshoot and find solutions to various technical issues.