Answers: <p>Maybe you created a cloud account with the same UPN before sync'ing the on premise with azure ad connect? or something else of that nature.</p>
  <p>Navigate to graph explorer <a href="https://developer.microsoft.com/en-us/graph/graph-explorer" rel="nofollow noreferrer">https://developer.microsoft.com/en-us/graph/graph-explorer</a> log in with a azure ad admin account and type in a query like this</p>
  <p><a href="https://graph.microsoft.com/v1.0/users?$filter=startswith(UserPrincipalName,%27##UPNHavingIssues##%27)" rel="nofollow noreferrer">https://graph.microsoft.com/v1.0/users?$filter=startswith(UserPrincipalName,'##UPNHavingIssues##')</a></p>
  <p>There should only be entry, but if there are multiple, then that's where the problem is.</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-09-01T11:59:54.550Z
Answers: Interesting, will test that.
Answers: RS Finance
Answers: CC BY-SA 4.0
Answers: 2023-08-31T16:09:54.373Z
Answers: 2023-08-31T16:09:54.373Z
Answers: geeky_girl
Body: <p>I am trying to connect my Azure DevOps environment to Azure Active Directory. I get the following error:</p>
  <blockquote>
  <p>Tenant switch failed, on a precondition, with the following message: 1
  of 10 total users has multiple active identities with the same UPN.
  Please either remove the duplicates or change the UPNs to be unique.</p>
  </blockquote>
  <p>There are only 9 users in Azure DevOps. The only thing I can think of is that a user is removed from the organisation and later readded, but I can't find any duplicates in the Users in DevOps. Also, in the target AAD there are no duplicates (I can't imagine you can have duplicate UPN anyway).</p>
  <p>I can't really find anything that can help met troubleshoot this issue. Anyone has any ideas to fix this?</p>
  
Tags: <azure-devops><azure><active-directory>
Title: Your organization X failed to connect to the X Azure Active Directory
UserDisplayName: RS Finance
ThreadText: # Your organization X failed to connect to the X Azure Active Directory
  
  (Asked by: username_0 on 2023-06-16)
  
  I am trying to connect my Azure DevOps environment to Azure Active Directory. I get the following error:
  
  > Tenant switch failed, on a precondition, with the following message: 1
  > of 10 total users has multiple active identities with the same UPN.
  > Please either remove the duplicates or change the UPNs to be unique.
  
  There are only 9 users in Azure DevOps. The only thing I can think of is that a user is removed from the organisation and later readded, but I can't find any duplicates in the Users in DevOps. Also, in the target AAD there are no duplicates (I can't imagine you can have duplicate UPN anyway).
  
  I can't really find anything that can help met troubleshoot this issue. Anyone has any ideas to fix this?
  
  **Tags:** azure-devops, azure, active-directory
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-08-31. Score: 1
  
  Maybe you created a cloud account with the same UPN before sync'ing the on premise with azure ad connect? or something else of that nature.
  
  Navigate to graph explorer <https://developer.microsoft.com/en-us/graph/graph-explorer> log in with a azure ad admin account and type in a query like this
  
  [https://graph.microsoft.com/v1.0/users?$filter=startswith(UserPrincipalName,'##UPNHavingIssues##')](https://graph.microsoft.com/v1.0/users?$filter=startswith(UserPrincipalName,%27##UPNHavingIssues##%27))
  
  There should only be entry, but if there are multiple, then that's where the problem is.
  
  > **Comments:**
  > **username_0**: Interesting, will test that.  
  
  ---
  
  