Quantcast
Viewing all articles
Browse latest Browse all 10096

CSOM : EnsureUser not working anymore

Hi,

We have a C# ASP.NET software that creates site collections in a specific manner. We're using CSOM 16.1.5715.1200.

This application needs to give some rights to some groups.

Everything worked fine as of Friday, 14th but since Monday, 17th our software can't use "Web.EnsureUser".

Neither our software or the o365 tenant changed, and we tested it on two different computers, with two different o365 tenants.

Here is how we retrieve security groups in our software :

User o365SharePointRead = newSiteContext.Web.EnsureUser("sharepoint-visiteurs");
newSiteContext.Load(o365SharePointRead);
User o365SharePointWrite = newSiteContext.Web.EnsureUser("sharepoint-membres");
newSiteContext.Load(o365SharePointWrite);
User o365SharePointOwner = newSiteContext.Web.EnsureUser("sharepoint-proprietaires");
newSiteContext.Load(o365SharePointOwner);

newSiteContext.ExecuteQuery();

And here is the exception message and stacktrace (Line number in CompteController.cs is the call to ExecuteQuery) :

Impossible de trouver le groupe.

  at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)

  at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()

  at SFLink.Controllers.CompteController.<>c__DisplayClass0_0.<CreateCompte>b__0() in CompteController.cs:line 63


Due to this problem, we can't deliver the software to our client yet, so it is quite urgent for us to get this problem solved.

Thank you for your help,

Flavien Lefebvre


Viewing all articles
Browse latest Browse all 10096

Trending Articles