Select-EntraGroupIdsGroupIsMemberOf
Gets group IDs that a group is a member of.
Syntax
Default (Default)
Select-EntraGroupIdsGroupIsMemberOf
-GroupId <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 -GroupId $group.Id -GroupIdsForMembershipCheck $groupObject
This example gets the group membership of a group identified by $GroupId. Use Get-EntraGroup
cmdlet to obtain group GroupId
value.
-GroupId
parameter specifies the group ID.-GroupIdsForMembershipCheck
Specifies an array of group object IDs.
Parameters
-GroupId
Specifies the ID of a group in Microsoft Entra ID.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | ObjectId |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-GroupIdsForMembershipCheck
Specifies an array of group object IDs.
Parameter properties
Type: | GroupIdsForMembershipCheck |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.