Admins assign owners to Microsoft Entra ID groups to delegate management responsibilities, ensuring proper oversight of group memberships, permissions, and access. While Microsoft Graph PowerShell's New-MgGroup Owner ByRef command, an alternative to PowerShell's Add-AzureADGroupOwner command, can be used to add owners to Entra ID groups, this process is both time-consuming and error-prone. In contrast, ManageEngine ADManager Plus, a Microsoft 365 management and reporting tool, streamlines the task, enabling administrators to quickly add owners to Entra ID groups with just a few clicks.
Before using the New-MgGroupOwnerByRef cmdlet, ensure the following prerequisites are met:
Install-Module Microsoft.Graph -Scope CurrentUser
Group.ReadWrite.All
The New-MgGroupOwnerByRef cmdlet can be used in Graph PowerShell to add owners to Entra ID groups. Here's the syntax:
New-MgGroupOwnerByRef
-GroupId <String>
[-ResponseHeadersVariable <String>]
-OdataId <String>
[-AdditionalProperties <Hashtable>]
[-Headers <IDictionary>]
[-PassThru]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add an owner to a group
$newGroupOwner =@{
"@odata.id"= "https://graph.microsoft.com/v1.0/users/{4de19c17-6a28-4a91-86d1-f717c3c8c229}"
}
New-MgGroupOwnerByRef -GroupId '1cb7317c-9c49-4dc8-a358-67ad8e95217c' -BodyParameter $newGroupOwner
The following table contains some parameters that can be used along with the New-MgGroupOwnerbyRef command to efficiently add members to Entra ID groups:
| Parameters | Description |
|---|---|
| -GroupId | This parameter displays the unique identifier for the group. |
| -Headers | This parameter allows you to add optional headers to the request. |
| -OdataId | This parameter displays the entity reference URL of the resource. |
| -PassThru | This parameter returns true when the command succeeds. |
| -WhatIf | This parameter displays the outcome if the cmdlet is executed. |