New-MgGroupMemberByRef — Export ResultsIT technician command center
Microsoft Graph · Entra ID and Graph

New-MgGroupMemberByRef — Export Results

Export the output of New-MgGroupMemberByRef for documentation or review.

Copy-ready commandNew-MgGroupMemberByRef — Export Results
New-MgGroupMemberByRef -GroupId $groupId -BodyParameter @{"@odata.id"="https://graph.microsoft.com/v1.0/directoryObjects/$userId"} | Export-Csv .\output.csv -NoTypeInformation
Production warning

Directory write operations can affect tenant access.

Requirements and permissions

Requirements
Microsoft.Graph PowerShell SDK
Permissions
Graph delegated or application permissions
Last reviewed
2026-07-31

Examples

Export Results

Export the output of New-MgGroupMemberByRef for documentation or review.

New-MgGroupMemberByRef -GroupId $groupId -BodyParameter @{"@odata.id"="https://graph.microsoft.com/v1.0/directoryObjects/$userId"} | Export-Csv .\output.csv -NoTypeInformation

Original command

Add a member to a Microsoft Entra ID group.

New-MgGroupMemberByRef -GroupId $groupId -BodyParameter @{"@odata.id"="https://graph.microsoft.com/v1.0/directoryObjects/$userId"}

Common errors

Command not found

Confirm Microsoft.Graph PowerShell SDK is installed and available in your current shell.