使用Graph API获取SharePoint组(而非AD组)

时间:2018-05-24 09:36:41

标签: microsoft-graph sharepoint-online

是否有使用Microsoft Graph检索SharePoint组的方法?

我可以使用https://graph.microsoft.com/v1.0/groups获取Azure目录组,但我正在寻找的是SharePoint Groups。

我可以使用SiteCollection获得https://graph.microsoft.com/beta/sites/{id},但我似乎无法在网站集中获取SharePoint群组。

1 个答案:

答案 0 :(得分:0)

仅在Microsoft Graph中无法轻松访问。如果您对SharePoint API有一定的访问权限,则可以从“用户信息列表”中获取GUID - 此时此处似乎隐藏了Microsoft Graph。该SharePoint API调用将是 GET HTTP https://sometenant.sharepoint.com/_api/web/lists?$select=title,id&$filter=Title%20eq%20%27User%20Information%20List%27

获得该列表的GUID后,您可以执行Graph调用: https://graph.microsoft.com/beta/sites/{site id}/lists/{list ID from the SharePoint API}/items

这将为您提供完整的成员列表,包括群组。这仍然是一个黑客攻击,因为您必须按照contentType / name eq'SharePointGroup'过滤这些组 - 这在图形资源管理器中似乎有些错误。尝试以编程方式访问它,此时很难。

相关问题