Hi Mates,
I need to extract the Azure ad group users using MS graph API, API call pulls out all members from the groups.
This means Azure ad group users and a few other groups as members.
I would like to apply a filter to pull out only users from the group.
{
"@odata.type": "#microsoft.graph.user",
"id": "7b0f0b83-406-b25a-1e70cc520ab0",
"displayName": "xyz",
},
{
"@odata.type": "#microsoft.graph.group",
"id": "cd243e66-df16-2efc34ff2332",
"displayName": "xyzgroup",
},
{
"@odata.type": "#microsoft.graph.group",
"id": "9c9855cd-4d16-0bf91ba16790",
"displayName": "xyzgrou2",
}
API :
https://graph.microsoft.com/v1.0/groups/e917f888-4e6b-b1f1-40a58159/members
normally i can select like $Select=id, displayname but can i select only users?
Please assist me
@Expiscornovus Thank you
Hi @Anonymous,
You can use the Odata cast to only retrieve members which are of type user.
Below is an example from the Graph API documentation:
GET https://graph.microsoft.com/v1.0/groups/{id}/members/microsoft.graph.user
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional