403 Forbidden Authorization_Request Denied when updating AD user properties

Rob Garden 0 Reputation points
2023-08-23T04:21:32.2766667+00:00

I have an automation runbook that updates AD user properties like mobile phone etc. I do not have any issues with non-administrator user changes, but anyone that is a O365 admin (and any level of admin) I am unable to update their mobile phone. I found the following and wanted to see if there was a workaround to this limitation (specifically the 2nd bullet). The 2nd point below seemed to suggest that if I added one of the listed roles to those admin users it would work .. but I tried and there was no change.

User's image

Source: https://learn.microsoft.com/en-us/graph/permissions-reference

The Directory.ReadWrite.All permission

  • No rights to reset user passwords.
  • Updating another user's businessPhones, mobilePhone, or otherMails property is only allowed on users who are non-administrators or assigned one of the following roles: Directory Readers, Guest Inviter, Message Center Reader and Reports Reader. For more details, see Helpdesk (Password) Administrator in Azure AD available roles. This is the case for apps granted either the User.ReadWrite.All or Directory.ReadWrite.All delegated or application permissions.
  • No rights to delete resources (including users or groups).
  • Specifically excludes create or update for resources not listed above. This includes: application, oAuth2PermissionGrant, appRoleAssignment, device, servicePrincipal, organization, domains, and so on.

Appreciate any guidance.

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
978 questions
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,376 Reputation points
    2023-08-23T08:16:24.3433333+00:00

    Hi @Rob Garden

    Normal users certainly can't update the administrator's mobilePhone attribute, which is a sensitive attribute, and updating this attribute is a sensitive action, and only administrators can perform sensitive actions.

    User's image

    If you want to change the admin's mobilePhone attribute, the calling user/app must have an admin role with higher privileges than the target admin. The following image shows higher privilege admin roles that can perform sensitive actions on admins, and you can grant these roles to your users/apps based on the index to change the sensitive attributes of the target admin.

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


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.