Add-EntraGroupOwner
Adds an owner to a group.
Syntax
Add-EntraGroupOwner
-GroupId <String>
-RefObjectId <String>
[<CommonParameters>]
Description
The Add-EntraGroupOwner
cmdlet adds an owner to a Microsoft Entra ID group. Specify the GroupId
and RefObjectId
parameters to add an owner to a group.
In delegated scenarios, the signed-in user must have either a supported Microsoft Entra role or a custom role with the necessary permissions. The minimum roles required for this operation are:
- Group owners
- User Administrator
- Directory Writers
- Groups Administrator
Examples
Example 1: Add an owner to a group
Connect-Entra -Scopes 'Group.ReadWrite.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
$user = Get-EntraUser -UserId 'SawyerM@contoso.com'
Add-EntraGroupOwner -GroupId $group.Id -RefObjectId $user.Id
This example demonstrates how to add an owner to a group.
-GroupId
- Specifies the unique identifier (Object ID) of the group to which you want to add an owner.-RefObjectId
- Specifies the unique identifier (Object ID) of the owner to be added to the group.
Parameters
-GroupId
Specifies the ID of a group in Microsoft Entra ID.
Type: | System.String |
Aliases: | ObjectId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RefObjectId
Specifies the ID of the Microsoft Entra ID object that will be assigned as owner/manager/member.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |