Microsoft graph: get only users from group

好久不见. 提交于 2020-01-24 12:04:19

问题


Just wondering if there's any way to get only the users placed inside an azure ad group. I've tried something like this:

var membros = await obtemUtilizadores
                .Filter("'odata.type' eq '#microsoft.graph.user'")
                .Select("id,userprincipalname,mail,displayname")
                .Expand("extensions($filter=id eq 'assistenciasExtensions')")
                .GetAsync().ConfigureAwait(false);

It translates into this url:

https://graph.microsoft.com/v1.0/groups/xxxxxx/members?
 $filter='odatatype eq 'microsoft.graph.user'&
 $select=id,userprincipalname,mail,displayname&
 $expand=extensions($filter=id eq 'assistenciasExtensions')

Which returns an error saying that the filter is wrong.

Btw, what I really need is to get all users from within group X with the assistenciasExtensions data.

Thanks.

Luis


回答1:


Unfortunately a service-side filter for this is not currently possible (filtering on the target of a navigation collection - for type and/or any property including extension properties). You'll need to get all members and then filter on the client side. Appreciate that this is pretty awful - I filed a user voice item for this - please feel free to vote for this feature. https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/suggestions/19587061-allow-filter-on-target-of-a-navigation-collection

Hope this helps,



来源:https://stackoverflow.com/questions/44531471/microsoft-graph-get-only-users-from-group

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!