SharePoint / SharePoint/sp-dev-docs

SharePoint Online (CSOM) - The user does not exist or is not unique.

Open
#10,163 12 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Mar 19, 2025.

sharepoint-developer-support type:bug-confirmed
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

What type of issue is this?

other

What SharePoint development model, framework, SDK or API is this about?

SharePoint CSOM

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details

My application is an C# Web Api (.NET 8) which serves as a middleware between my system and SharePointOnline. The application will be integrating with SharePointOnline by using SharePoint CSOM library (Microsoft.SharePointOnline.CSOM v16.1.21213.12000) from Nuget.

Issue description

Hi. I have a SharePointOnline list composed of 2 columns as below.

  • Title (Text type)
  • AssetManager (People type)

I have 3 users created in Microsoft Entra ID as below:-
a) User#1

  • Principal name: ******@myspotest.onmicrosoft.com
  • Display name: John, Doe
  • Status: Active & Enabled (MS Entra ID)

b) User#2

  • Principal name: ******@myspotest.onmicrosoft.com
  • Display name: John, Humming
  • Status: Active & Enabled (MS Entra ID)

c) User#3

  • Principal name: ******@myspotest.onmicrosoft.com
  • Display name: John, Tim
  • Status: Active & Enabled (MS Entra ID)

My application is using

SampleCode.zip

to create item(s) to the SharePoint list. I have uploaded the sample code extracted from my application to GitHub, also available in the attachment section. I am using Microsoft.SharePoint.Client.FieldUserValue.FromUser(@DisplayName) to lookup people by DisplayName to populate the AssetManager column (People type). All the 3 users are active but the lookup works for user#1 but not for user#2 & user#3. I received the following errors when lookup for User#2 & User#3.

#User#2

  • Error ServerErrorCode = -2130575276
  • ServerErrorTraceCorrelationId = "f76070a1-b0da-7000-73f7-37734443b28b"
  • ServerErrorTypeName = "Microsoft.SharePoint.SPException"
  • Message = Message = "The user does not exist or is not unique."
  • Source = Source = "Microsoft.SharePoint.Client.Runtime"

#User#3

  • Error ServerErrorCode = -2130575276
  • ServerErrorTraceCorrelationId = "206170a1-608d-7000-2916-c89268d414be"
  • ServerErrorTypeName = "Microsoft.SharePoint.SPException"
  • Message = Message = "The user does not exist or is not unique."
  • Source = Source = "Microsoft.SharePoint.Client.Runtime"

Could you please advise why the lookup failed? Do let me know if you need more info. Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.