Can't update other's sharepoint user profile by REST API even though I am already an administrator

%3CLINGO-SUB%20id%3D%22lingo-sub-283452%22%20slang%3D%22en-US%22%3ECan't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrator%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283452%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EI%20am%20trying%20to%20update%20other's%20user%20profile%20in%20our%20site%2C%20but%20I%20am%20not%20able%20to%20do%20it%20with%20%22POST%22%20REST%20call.%20Getting%20permission%20denied%20error.%20Even%20though%20I%20am%20already%20administrator%20of%20the%20site.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EHere%20is%20the%20REST%20call%20I%20made%3A%20%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Frobomq.sharepoint.com%2F_api%2FSP.UserProfiles.PeopleManager%2FSetSingleValueProfileProperty%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2F%3CSHAREPOINT%20domain%3D%22%22%3E.sharepoint.com%2F_api%2FSP.UserProfiles.PeopleManager%2FSetSingleValueProfileProperty%3C%2FSHAREPOINT%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20error%20response%20is%3A%20%7B%20%22error%22%3A%20%7B%20%22code%22%3A%20%22-2147024891%2C%20System.UnauthorizedAccessException%22%2C%20%22message%22%3A%20%7B%20%22lang%22%3A%20%22en-US%22%2C%20%22value%22%3A%20%22Access%20denied.%20You%20do%20not%20have%20permission%20to%20perform%20this%20action%20or%20access%20this%20resource.%22%20%7D%20%7D%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20made%20the%20REST%20Call%20to%20Sharepoint%20by%20using%20Postman%20with%20the%20access%20token.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-283841%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283841%22%20slang%3D%22en-US%22%3E%3CP%3EAny%20of%20the%20properties.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20%22Allow%20user%20to%20edit%20values%20for%20this%20property%22%20is%20checked%2C%20then%20I%20can%20edit%20mine%2C%20but%20can't%20edit%20others%20(%3CSTRONG%3Eerror%20code%20-2147024891%2C%20UnauthorizedAccessException%2C%20Access%20denied.%20You%20do%20not%20have%20permission%20to%20perform%20this%20action%20or%20access%20this%20resource%3C%2FSTRONG%3E).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20unchecked%2C%20I%20can't%20even%20update%26nbsp%3Bmine(%3CSTRONG%3Eerror%20code%201%2C%20PropertyNotEditableException%2C%20Property%20Not%20Editable%3A%20This%20property%20can%20only%20be%20modified%20by%20an%20administrator%3C%2FSTRONG%3E.)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBelow%20is%20the%20check%20box%20I%20mentioned%20in%20the%20sharepoint%20admin%20center%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F59296iD81C1ADC9BC5315A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22sharepoint-edit.png%22%20title%3D%22sharepoint-edit.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-283838%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283838%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20have%20enough%20permissions!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20have%20issue%20with%20any%20specific%26nbsp%3Buser%20property%20or%20you%20are%20not%20able%20to%20update%20any%20of%20the%20properties%20of%20other%20user%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJayakumar%20B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-283837%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283837%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20you%20can%20see%2C%20I%20am%20already%20a%20global%20administrator.%20But%20I%20still%20can%20not%20edit%20other's%20sharepoint%20profile.%20Is%20there%20any%20other%20settings%20for%20administrator%20permission%20comes%20to%20your%20mind%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F59295i06F9EC5263802452%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22global-admin.png%22%20title%3D%22global-admin.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-283834%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283834%22%20slang%3D%22en-US%22%3E%3CP%3EGo%20to%20the%20below%20URL%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fadmin.microsoft.com%2FAdminPortal%2FHome%23%2Fusers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fadmin.microsoft.com%2FAdminPortal%2FHome%23%2Fusers%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhich%20will%20list%20you%20all%20the%20users's%20if%20you%20have%20enough%20permissions%2C%20then%20click%20on%20the%20username%20and%20you%20can%20find%20a%20popup%20opens%20from%20the%20left.%20Roles%20section%20will%20tell%20your%20permission%20on%20the%20tenant.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20843px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F59293i4C0FF0C12DC8D861%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22admin_roles.JPG%22%20title%3D%22admin_roles.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJayakumar%20B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-283826%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283826%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20response!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20Sharepoint%20Online%2C%20and%20I%20am%20global%20administrator%20in%20Office%20365.%20Do%20you%20know%20how%20to%20check%20whether%20I%20am%20SharePoint%20Admin%2FTenant%20Admin%20permission%3F%20And%20how%20to%20grant%20SharePoint%20Admin%2FTenant%20Admin%20permission%20to%20me%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-283824%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283824%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239466%22%20target%3D%22_blank%22%3E%40Jack%20Huang%3C%2FA%3E%26nbsp%3BSite%20Admin%20permission%20is%20not%20enough%20to%20update%20other%20user%20profile%20properties.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEither%20you%20need%20SharePoint%20Admin%2FTenant%20Admin%20permission.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJayakumar%20B.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-645779%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-645779%22%20slang%3D%22en-US%22%3EDid%20you%20find%20a%20solution%20to%20this%20problem%3F%20I%20am%20also%20facing%20the%20same%20issue%20but%20no%20luck%20with%20solution%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-727958%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727958%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239466%22%20target%3D%22_blank%22%3E%40Jack%20Huang%3C%2FA%3E%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F348598%22%20target%3D%22_blank%22%3E%40Shanky1690%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20too%20come%20across%20the%20same%20issue.%20In%20my%20case%20I%20tried%20with%20MS%20Flow%20as%20in%20below%20screenshot%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20545px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121582iF1FD57F7FA8DA9CD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22userPropertyUpdate.PNG%22%20title%3D%22userPropertyUpdate.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20instead%20of%20using%20below%20URI%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3Ehttps%3A%2F%2F%3CCOMPANYNAME%3E.sharepoint.com%2F_api%2FSP.UserProfiles.PeopleManager%2FSetSingleValueProfileProperty%3C%2FCOMPANYNAME%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20used%20the%20below%20URI%20and%20able%20to%20update%20the%20Property%20successfully.%20And%20the%20account%20I%20used%20is%20Global%20Admin.%3C%2FP%3E%3CP%3E%3CSTRONG%3Ehttps%3A%2F%2F%3CCOMPANYNAME%3E-admin.sharepoint.com%2F_api%2FSP.UserProfiles.PeopleManager%2FSetSingleValueProfileProperty%3C%2FCOMPANYNAME%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20able%20to%20perform%20this%20action%20for%20UserProperties%20that%20are%20not%20set%20to%20'%3CSPAN%3EAllow%20users%20to%20edit%20values%20for%20this%20property%3C%2FSPAN%3E'%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20is%20helpful!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1116192%22%20slang%3D%22en-US%22%3ERe%3A%20Can't%20update%20other's%20sharepoint%20user%20profile%20by%20REST%20API%20even%20though%20I%20am%20already%20an%20administrat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1116192%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185211%22%20target%3D%22_blank%22%3E%40Aravind%20Ganesan%3C%2FA%3E%26nbsp%3B%20Thank%20you!%2C%20It's%20work%20for%20me!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I am trying to update other's user profile in our site, but I am not able to do it with "POST" REST call. Getting permission denied error. Even though I am already administrator of the site.

 

Here is the REST call I made: https://<sharepoint domain>.sharepoint.com/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileP...

 

The error response is: { "error": { "code": "-2147024891, System.UnauthorizedAccessException", "message": { "lang": "en-US", "value": "Access denied. You do not have permission to perform this action or access this resource." } } }

 

I made the REST Call to Sharepoint by using Postman with the access token. 

9 Replies
Highlighted

Hi @Jack Huang Site Admin permission is not enough to update other user profile properties.

 

Either you need SharePoint Admin/Tenant Admin permission.

 

Thanks,

Jayakumar B.

Highlighted

Hi,

 

Thanks for your response!

 

I am using Sharepoint Online, and I am global administrator in Office 365. Do you know how to check whether I am SharePoint Admin/Tenant Admin permission? And how to grant SharePoint Admin/Tenant Admin permission to me?

Highlighted

Go to the below URL

https://admin.microsoft.com/AdminPortal/Home#/users

 

Which will list you all the users's if you have enough permissions, then click on the username and you can find a popup opens from the left. Roles section will tell your permission on the tenant.

 

admin_roles.JPG

 

Thanks,

Jayakumar B

Highlighted

As you can see, I am already a global administrator. But I still can not edit other's sharepoint profile. Is there any other settings for administrator permission comes to your mind?

 

 

global-admin.png

 

Highlighted

You have enough permissions!!

 

Do you have issue with any specific user property or you are not able to update any of the properties of other user ?

 

Thanks,

Jayakumar B

Highlighted

Any of the properties.

 

If "Allow user to edit values for this property" is checked, then I can edit mine, but can't edit others (error code -2147024891, UnauthorizedAccessException, Access denied. You do not have permission to perform this action or access this resource).

 

If unchecked, I can't even update mine(error code 1, PropertyNotEditableException, Property Not Editable: This property can only be modified by an administrator.)

 

Below is the check box I mentioned in the sharepoint admin center

 

sharepoint-edit.png

Highlighted
Did you find a solution to this problem? I am also facing the same issue but no luck with solution
Highlighted

@Jack Huang  @Shanky1690 

 

I too come across the same issue. In my case I tried with MS Flow as in below screenshot

 

userPropertyUpdate.PNG

 

So, instead of using below URI, 

https://<companyName>.sharepoint.com/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty

I used the below URI and able to update the Property successfully. And the account I used is Global Admin.

https://<companyName>-admin.sharepoint.com/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty

 

 

Also, able to perform this action for UserProperties that are not set to 'Allow users to edit values for this property'

 

Hope this is helpful!

Highlighted