r/PowerShell • u/Unlikely_Tie1172 MVP, Community Blogger • Oct 20 '26
News Why the Microsoft Graph PowerShell SDK has Two Cmdlets to Add Group Members
Itβs a consequence of how the Microsoft Graph PowerShell SDK is built that two cmdlets are available to add members to Entra ID groups (the same is true for group owners). The reason why the New-MgGroupMember and New-MgGroupMemberByRef cmdlets exist is down to how the Graph SDK build process constructs cmdlets from Graph metadata. The Graph exposes two ways to add new group members, so the SDK follows suit.
https://office365itpros.com/2026/10/20/group-member-sdk-cmdlets/
3
Upvotes
5
u/wissarking Oct 20 '26
Just bypass the graph cmdlets and use invoke-mggraphrequest for direct graph API usage in powershell.
1
u/BlackV Oct 20 '26 edited Oct 20 '26
so is one essentially wanting and odata object (byref) and the other is a bit more flexible ?
Edit: hmm actually my code
is also using the odata (limit of 20 members per request)
so maybe not
appreciate your blogs btw