Invalid role error

Nadim Akhtar-MSFT 0 Reputation points Microsoft Vendor

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.

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.
11,319 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saman Guruge-MSFT 80 Reputation points Microsoft Vendor

    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