Confirm-MgBetaDirectoryObjectMemberGroup

Check for membership in a specified list of group IDs, and return from that list those groups (identified by IDs) of which the specified user, group, service principal, organizational contact, device, or directory object is a member. This function is transitive. You can check up to a maximum of 20 groups per request. This function supports all groups provisioned in Microsoft Entra ID. Because Microsoft 365 groups cannot contain other groups, membership in a Microsoft 365 group is always direct.

Note

To view the v1.0 release of this cmdlet, view Confirm-MgDirectoryObjectMemberGroup

Syntax

Confirm-MgBetaDirectoryObjectMemberGroup
       -DirectoryObjectId <String>
       [-ResponseHeadersVariable <String>]
       [-AdditionalProperties <Hashtable>]
       [-GroupIds <String[]>]
       [-Headers <IDictionary>]
       [-ProgressAction <ActionPreference>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Confirm-MgBetaDirectoryObjectMemberGroup
       -DirectoryObjectId <String>
       -BodyParameter <IPaths1Ffes6MDirectoryobjectsDirectoryobjectIdMicrosoftGraphCheckmembergroupsPostRequestbodyContentApplicationJsonSchema>
       [-ResponseHeadersVariable <String>]
       [-Headers <IDictionary>]
       [-ProgressAction <ActionPreference>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Confirm-MgBetaDirectoryObjectMemberGroup
       -InputObject <IDirectoryObjectsIdentity>
       [-ResponseHeadersVariable <String>]
       [-AdditionalProperties <Hashtable>]
       [-GroupIds <String[]>]
       [-Headers <IDictionary>]
       [-ProgressAction <ActionPreference>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Confirm-MgBetaDirectoryObjectMemberGroup
       -InputObject <IDirectoryObjectsIdentity>
       -BodyParameter <IPaths1Ffes6MDirectoryobjectsDirectoryobjectIdMicrosoftGraphCheckmembergroupsPostRequestbodyContentApplicationJsonSchema>
       [-ResponseHeadersVariable <String>]
       [-Headers <IDictionary>]
       [-ProgressAction <ActionPreference>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

Check for membership in a specified list of group IDs, and return from that list those groups (identified by IDs) of which the specified user, group, service principal, organizational contact, device, or directory object is a member. This function is transitive. You can check up to a maximum of 20 groups per request. This function supports all groups provisioned in Microsoft Entra ID. Because Microsoft 365 groups cannot contain other groups, membership in a Microsoft 365 group is always direct.

Permissions

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Application.Read.All Application.ReadWrite.All, Device.Read.All, Directory.Read.All, Directory.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, GroupMember.Read.All, User.Read.All, User.ReadBasic.All, User.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application Application.Read.All Application.ReadWrite.All, Device.Read.All, Device.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, GroupMember.Read.All, User.Read.All, User.ReadWrite.All

Examples

Example 1: Check group memberships for a directory object

Import-Module Microsoft.Graph.Beta.DirectoryObjects

$params = @{
	groupIds = @(
		"f448435d-3ca7-4073-8152-a1fd73c0fd09"
		"bd7c6263-4dd5-4ae8-8c96-556e1c0bece6"
		"93670da6-d731-4366-94b5-abed40b6016b"
		"f5484ab1-4d4d-41ec-a9b8-754b3957bfc7"
		"c9103f26-f3cf-4004-a611-2a14e81b8f79"
	)
}

Confirm-MgBetaDirectoryObjectMemberGroup -DirectoryObjectId $directoryObjectId -BodyParameter $params

This example will check group memberships for a directory object

Parameters

-AdditionalProperties

Additional Parameters

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

-BodyParameter

. To construct, see NOTES section for BODYPARAMETER properties and create a hash table.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DirectoryObjectId

The unique identifier of directoryObject

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

-GroupIds

.

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

-Headers

Optional headers that will be added to the request.

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

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

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

-ProgressAction

{{ Fill ProgressAction Description }}

Type:ActionPreference
Aliases:proga
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResponseHeadersVariable

Optional Response Headers Variable.

Type:String
Aliases:RHV
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Graph.Beta.PowerShell.Models.IDirectoryObjectsIdentity

Microsoft.Graph.Beta.PowerShell.Models.IPaths1Ffes6MDirectoryobjectsDirectoryobjectIdMicrosoftGraphCheckmembergroupsPostRequestbodyContentApplicationJsonSchema

System.Collections.IDictionary

Outputs

System.String

Notes

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

BODYPARAMETER <IPaths1Ffes6MDirectoryobjectsDirectoryobjectIdMicrosoftGraphCheckmembergroupsPostRequestbodyContentApplicationJsonSchema>: .

  • [(Any) <Object>]: This indicates any property can be added to this object.
  • [GroupIds <String- []>]:

INPUTOBJECT <IDirectoryObjectsIdentity>: Identity Parameter

  • [DirectoryObjectId <String>]: The unique identifier of directoryObject