Insufficient Rights for mggraph command New-MgGroupMember

Jo Beier 20 Reputation points
2025-02-18T09:19:46.9566667+00:00

New-MgGroupMember -GroupId $GroupId -DirectoryObjectId $DeviceId

Error: New-MgGroupMember_CreateExpanded: Insufficient privileges to complete the operation.

MGGraph Scope rights:

Device.Read.All

Device.ReadWrite.All

Group.Read.All

Group.ReadWrite.All

DeviceManagementConfiguration.Read.All

GroupMember.ReadWrite.All

Does anybody know what rights am I missing?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,293 questions
0 comments No comments
{count} votes

Accepted answer
  1. Deepanshu katara 14,585 Reputation points MVP
    2025-02-18T09:30:13.42+00:00

    Hello , Welcome to MS Q&A

    Try Adding a scope of "Directory.Read.All and consent if prompted as it is needed for group members and user details

    Connect-MgGraph -Scopes Directory.Read.All

    Also , If you are making a PowerShell connection to your GraphAPI app, make sure your GraphAPI permission type in Entra is using Application consent and not delegate consent!

    Please let us know if any questions.

    Kindly accept answer if it helps

    Thanks
    Deepanshu


0 additional answers

Sort by: Most 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.