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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,830 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 103.9K Reputation points MVP
    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


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.