问题
I'm using the Graph Explorer to play with the Microsoft Graph. I understand you can access a group by specifying its id, like so -
https://graph.microsoft.com/v1.0/groups/14481298-e121-4d97-91d5-3fe555aa2871
and you can get its members as well like this -
https://graph.microsoft.com/v1.0/groups/14481298-e121-4d97-91d5-3fe555aa2871/members
But it isn't clear to me how you lookup a group by its email address and list the members in one call. I now know, so I thought I would share, and also ask if there is a better way.
回答1:
To get the group by email you can filter by the mail property. However this does return an array, which is slightly different from the original query.
https://graph.microsoft.com/v1.0/groups/?$filter=mail+eq+'sampleDL@example.com'
To get the members you can expand members.
https://graph.microsoft.com/v1.0/groups/?$filter=mail+eq+'sampleDL@example.com'&$expand=members
来源:https://stackoverflow.com/questions/37221122/using-the-microsoft-graph-how-do-i-look-up-a-group-by-email-address