PeopleManager peopleManager = new PeopleManager(clientContext);
PersonProperties personProperties = peopleManager.GetMyProperties();

    clientContext.Load(personProperties, p => p.AccountName, p => p.UserProfileProperties);
catch (Exception ex)
   Console.Write("error occur while retrieve person properties ", ex.Message.ToString());


<AppPermissionRequests AllowAppOnlyPolicy="true">
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />

After providing tenant permission it still showing - You do not have permission to perform this action or access this resource.

Thanks for the help!

  • Funny, I had the same issue today, but in PnP Powershell – Kasper Bo Larsen Jun 27 '18 at 13:47
  • It resolved after: <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Read" /> – Utkarsh Dubey Sep 10 '18 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.