I use the Graph API to query my Azure Active Directory, using the Microsoft.WindowsAzure.ActiveDirectory.GraphHelper
project as the base for my queries.
In the specific use case, I have a group that contains several hundred users, as well as several groups. I am looking to download group members of this parent group. I tried to request the loading of the members
property:
DirectoryService.LoadProperty(school, "members");
I get only 100 results, all of which are users (again, in the group of more than 100 users).
I tried to execute DataServiceQuery
, but does not support such an operation:
var groups = DirectoryService.groups; Group parentGroup = DirectoryService.groups.Where(it => (it.objectId == parentGroupId)).SingleOrDefault(); groups = (DataServiceQuery<Group>)groups.Where(group => group.memberOf.Contains(parentGroup));
In the third line, it does not work there that the expression is not supported.
Currently, the only solution I can think of is to load ALL groups, run LoadPropert(entity, 'memberOf', null)
for each of them, and then check each of them if it is a member of parentGroup (in fact, one of several such parent groups). note. I put null
in the continuationToken
space since these groups should only be members of the same parent group.
It is terribly inefficient, but I cannot find another way!
Is there any other way to do what I'm trying to do?
source share