Invalid role error

Nadim Akhtar-MSFT 0 Reputation points Microsoft Vendor
2023-11-24T01:23:21.16+00:00

One of my user admin is trying to upload the profile photo of another non admin user and he is getting the error mentioned below.

Set-MgUserPhotoContent -UserId

Set-MgUserPhotoContent : invalid_role

Status: 403 (Forbidden)

ErrorCode: ForbiddenByPolicy

Date: 2023-11-13T08:49:50

As per the user does have user admin role and necessary delegated permissions.

https://learn.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-1.0&tabs=http

Does it not work with user admin role?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,753 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saman Guruge-MSFT 80 Reputation points Microsoft Vendor
    2023-11-25T19:13:44.7466667+00:00

    Based on the error you’ve encountered, it appears that the upload of your profile picture is being blocked by a policy defined in the Security section of the Azure portal. Please check if there is an active policy that restricts the upload of profile images.

    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly.

    If you thought this post was helpful, please give it a Thumbs Up.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.