Get-MgSubscribedSku : Insufficient privileges to complete the operation.

Marin Marinov 161 Reputation points
2023-12-15T15:56:58.5566667+00:00

Hi there, On trying to list the available licenses I got the below error message.

Get-MgSubscribedSku : Insufficient privileges to complete the operation.
Status: 403 (Forbidden)
ErrorCode: Authorization_RequestDenied
Date: 2023-12-15T15:48:39
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 3ece69c6-af61-4054-bedb-87992eb8f54e
client-request-id : 0e810f99-607c-4e19-8e07-19cb384e49d0
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Germany West
Central","Slice":"E","Ring":"5","ScaleUnit":"003","RoleInstance":"FR1PEPF00000AF1"}}
x-ms-resource-unit : 3
Cache-Control : no-cache

I connected using the right scope.

Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All" -UseDeviceAuthentication

Also, I used the global admin account.

any idea how to gane the required access?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,601 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,946 questions
{count} votes

Accepted answer
  1. Andy David - MVP 156K Reputation points MVP Moderator
    2023-12-17T21:31:28.1633333+00:00

    Try Adding a scope of "Directory.Read.All and consent if prompted.

    Connect-MgGraph -Scopes Directory.Read.All

    4 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Andy David - MVP 156K Reputation points MVP Moderator
    2023-12-15T18:17:49.6466667+00:00

    Were you ever prompted to consent those permissions you requested? That command should work as a Global Reader.

    Look in the Azure portal under Enterprise Apps for

    "Microsoft Graph Command Line Tools"

    or APP ID: 14d82eec-204b-4c2f-b7e8-296a70dab67e

    and then go to Permissions and see what is set there for allowed permissions.

    I am assuming you arent using your own app registration for this, correct?

    1 person found this answer helpful.
    0 comments No comments

  2. Marin Marinov 161 Reputation points
    2023-12-17T14:15:28.4066667+00:00

    Hi Andy, on the screenshot you can see the what is listed under "Permissions". After running Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All" I was asked to type admin credentials. The first time I was prompted to grand permissions too. I`m not using own app registration. Screenshot 2023-12-17 160804

    0 comments No comments

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.