Microsoft Graph Permissions



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

1 answer

Sort by: Most helpful
  1. Vasil Michev 85,641 Reputation points MVP

    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

    0 comments No comments