Skip to main content

members

Creates, updates, deletes, gets or lists a members resource.

Overview

Namemembers
TypeResource
Identra_id.groups.members

Fields

The following fields are returned by SELECT queries:

Retrieved collection

NameDatatypeDescription
idstringThe unique identifier for an entity. Read-only.
deletedDateTimestring (date-time)Date and time when this object was deleted. Always null when the object hasn't been deleted. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectgroup_idConsistencyLevelGet a list of the group's direct members. A group can have users, organizational contacts, devices, service principals and other groups as members. This operation is not transitive.
add_refinsertgroup_idAdd a member to a security or Microsoft 365 group. When using the API to add multiple members in one request, you can add up to only 20 members. The following table shows the types of members that can be added to either security groups or Microsoft 365 groups.
remove_refdeletegroup_id, directory_object_idIf-MatchRemove a member from a group via the members navigation property. You can't remove a member from groups with dynamic memberships.
remove_ref_2deletegroup_idIf-MatchRemove a member from a group via the members navigation property. You can't remove a member from groups with dynamic memberships.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
directory_object_idstringThe unique identifier of directoryObject
group_idstringThe unique identifier of group
ConsistencyLevelstringIndicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries
If-MatchstringETag

SELECT examples

Get a list of the group's direct members. A group can have users, organizational contacts, devices, service principals and other groups as members. This operation is not transitive.

SELECT
id,
deletedDateTime
FROM entra_id.groups.members
WHERE group_id = '{{ group_id }}' -- required
AND ConsistencyLevel = '{{ ConsistencyLevel }}'
;

INSERT examples

Add a member to a security or Microsoft 365 group. When using the API to add multiple members in one request, you can add up to only 20 members. The following table shows the types of members that can be added to either security groups or Microsoft 365 groups.

INSERT INTO entra_id.groups.members (
directoryObjectId,
group_id
)
SELECT
'{{ directoryObjectId }}',
'{{ group_id }}'
;

DELETE examples

Remove a member from a group via the members navigation property. You can't remove a member from groups with dynamic memberships.

DELETE FROM entra_id.groups.members
WHERE group_id = '{{ group_id }}' --required
AND directory_object_id = '{{ directory_object_id }}' --required
AND If-Match = '{{ If-Match }}'
;