Microsoft Graph Permissions

Anonymous
2023-11-10T16:04:33.5966667+00:00

Hi

I am trying to assign a license to a user using the powershell command Set-MgUserLicense but I keep getting the below error insufficient privileges , Does anyone know what permission is needed in azure for this ?

Set-MgUserLicense : Insufficient privileges to complete the operation.

Status: 403 (Forbidden)

ErrorCode: Authorization_RequestDenied

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2023-11-10T18:17:58.8366667+00:00

    The user you are running with must have at least the User administrator role, and you must connect to the Graph SDK via at least User.ReadWrite.All permissions.

    Connect-MgGraph -Scopes User.ReadWrite.All

    1 person found this answer helpful.

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.