GraphServiceClient从名称获取组

问题描述 投票:1回答:1

我想找到一个给定组的所有成员,而我只有组名称(而不是ID)。反正有从名字得到一组与GraphServiceClient? Onlything我发现需要ID:

var users = await graphClient.Groups[group.Id].Members.Request().GetAsync();
azure-ad-graph-api
1个回答
0
投票

您可以将过滤器使用的查询参数和组通过使用显示名称搜索组。例如 - 你可以搜索其显示名以“测试”像下面开始组:

var result = await client.Groups.Request().Filter("startswith(displayName,'Test')").Select("displayName,description,id").GetAsync();
© www.soinside.com 2019 - 2024. All rights reserved.