Get-EntraGroupOwner

Gets an owner of a group.

Syntax

Get-EntraGroupOwner
   -GroupId <String>
   [-All]
   [-Top <Int32>]
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraGroupOwner cmdlet gets an owner of a group in Microsoft Entra ID. Specify GroupId parameter gets an owner of a group.

In delegated scenarios, the signed-in user must have a supported Microsoft Entra role or a custom role with the microsoft.directory/groups/owners/read permission. The following least privileged roles support this operation:

  • Group owners
  • Directory Readers
  • Directory Writers
  • Groups Administrator
  • User Administrator

Examples

Example 1: Get a group owner by ID

Connect-Entra -Scopes 'GroupMember.Read.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraGroup -GroupId $group.Id | Get-EntraGroupOwner | Select-Object Id, DisplayName, '@odata.type'

id                                   displayName       @odata.type
--                                   -----------       -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Adele Vance #microsoft.graph.user

This example demonstrates how to retrieve the owner of a specific group.

  • -GroupId Parameter specifies the ID of a group.

Example 2: Gets all group owners

Connect-Entra -Scopes 'GroupMember.Read.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraGroupOwner -GroupId $group.Id -All

Id                                   DeletedDateTime
--                                   ---------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
bbbbbbbb-1111-2222-3333-cccccccccccc
cccccccc-2222-3333-4444-dddddddddddd
dddddddd-3333-4444-5555-eeeeeeeeeeee

This example demonstrates how to retrieve the all owner of a specific group.

  • -GroupId Parameter specifies the ID of a group.

Example 3: Gets two group owners

Connect-Entra -Scopes 'GroupMember.Read.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraGroupOwner -GroupId $group.Id -Top 2

Id                                   DeletedDateTime
--                                   ---------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
bbbbbbbb-1111-2222-3333-cccccccccccc

This example demonstrates how to retrieve the top two owners of a specific group.

  • -GroupId parameter specifies the ID of a group.

Parameters

-All

List all pages.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-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

-Property

Specifies properties to be returned.

Type:System.String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Top

Specifies the maximum number of records to return.

Type:System.Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False