AADSTS51004 error on Teams: how to fix it

The AADSTS51004 Teams error is not so common, but there's a simple fix.

Reading time icon 2 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

Key notes

  • This bug doesn't affect only Teams, but other Microsoft apps as well.
  • Make sure you log in with a proper account, and double-check it every time.
  • Check your Microsoft tenancy and see if it's still available.
aadsts51004 teams error

Microsoft Teams might be the most popular app for working. The app now has a lot of excellent AI-based features that allow you to work efficiently. You can use AI recap, to quickly summarize a meeting. You can create organizational charts, and use them to build a better workflow. All these are in Microsoft Teams.

If you can log in, of course. Why we’re saying this? Well, there is a particularly stressful bug that you can run into sometimes on Teams. We’re talking about the AADSTS51004 error.

The AADSTS51004 Teams error happens in various forms. But they all have the same issue. There is a problem while trying to sign up to Microsoft website, a Microsoft app, such as Teams, or even a Microsoft could, such as OneDrive.

When the signing up fails, there are a lot of times when this particular error shows up. It can appear like this AADSTS51004: The user account 4ZtVnLfa9UfSXjKe/32NLQ== does not exist in the 4842004-47b3-4aso-8f12-797e13d1-y823 directory. To sign into this application, the account must be added to the directory. And it can appear simply like this AADSTS51004: The user account ….

How to fix the AADSTS51004 Teams error

First, this error means that the user account doesn’t exist in the Microsoft account directory. A Microsoft application, in our case Teams, likely chose the wrong tenant to sign into. And now, the currently logged-in user was prevented from doing so since it doesn’t have a tenancy.

What to do then? Well, if this user should be able to log in, add them as a guest.

To add B2B collaboration users to the directory, you need to follow these steps.

  1. Sign in to the Azure portal in the User Administrator role. A role with Guest Inviter privileges can also invite external users.
  2. Navigate to Azure Active Directory, then go to the Users panel.
  3. Select Invite external user from the menu.aadsts51004 teams error

From there you can add the existing profile and customize it. Ultimately you can add a tenancy to it, and then it will be all good.

However, the simplest solution to this would be to check if your account still has a Microsoft 365 tenancy, and if not, then renew it.

We hope you found these solutions useful. Be sure to let us know if it worked in the comments section below.

More about the topics: Microsoft Teams, Windows 11

User forum

0 messages