Select-EntraGroupIdsGroupIsMemberOf

Gets group IDs that a group is a member of.

Syntax

Select-EntraGroupIdsGroupIsMemberOf
      -ObjectId <String>
      -GroupIdsForMembershipCheck <GroupIdsForMembershipCheck>
      [<CommonParameters>]

Description

The Select-EntraGroupIdsGroupIsMemberOf cmdlet gets the groups that a specified group is a member of in Microsoft Entra ID.

Examples

Example 1: Get the group membership of a group for a group

Connect-Entra -Scopes 'GroupMember.Read.All'
$groupObject = New-Object Microsoft.Open.AzureAD.Model.GroupIdsForMembershipCheck
$groupObject.GroupIds = (Get-EntraGroup -Filter "displayName eq 'Tailspin Toys'").Id
$group = Get-EntraGroup -Filter "displayName eq 'sg-Legal'"
Select-EntraGroupIdsGroupIsMemberOf  -ObjectId $group.Id -GroupIdsForMembershipCheck $groupObject

This example gets the group membership of a group identified by $GroupId. Use Get-EntraGroup cmdlet to obtain group ObjectId value.

  • -ObjectId parameter specifies the group ID.
  • -GroupIdsForMembershipCheck Specifies an array of group object IDs.

Parameters

-GroupIdsForMembershipCheck

Specifies an array of group object IDs.

Type:GroupIdsForMembershipCheck
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ObjectId

Specifies the ID of a group in Microsoft Entra ID.

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