Microsoft Graph API、获取 SharePoint 网站 Admin/Members

Microsoft Graph API, Get SharePoint Site Admin/Members

尝试使用 Microsoft 的 Graph API 遍历 Sharepoint 站点,以便在用户出国时查找并删除对站点的访问权限。

图表/Sharepoint API 文档:https://docs.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-1.0

我使用“获取站点”端点获取所有站点的列表:

https://graph.microsoft.com/v1.0/sites

然后我过滤掉个人/OneDrive 站点,并尝试使用 List Site Permissions 端点来尝试获取 admins/members:https://docs.microsoft.com/en-us/graph/api/site-list-permissions?view=graph-rest-beta&tabs=http

不幸的是,我得到一个空的 value 数组来响应所有站点:

{'@odata.context': "https://graph.microsoft.com/v1.0/$metadata#sites('<domain>.sharepoint.com%asdfasdgsdf-ca8f-4ec1-bb3e-sdfsdfsdgsdf%2Cbed949c3-3f83-47c2-a263-sdfsdfsdgasdf')/permissions", 'value': []}

我知道查询没问题,因为如果我将其更改为点击站点列表端点,我会收到包含各种值的响应:

{'@odata.context': "https://graph.microsoft.com/v1.0/$metadata#sites('<domain>.sharepoint.com%sdfsdfsdgsd-7dce-4564-9de8-eb2dfc02eb86%sdfsdgsdfsdf-ab8c-464f-a77d-sdfsdfsdgsdg')/lists", 'value': [{'@odata.etag': '"sfwsdgsdg-aff1-4295-8443-sdfsdgasdf,7"', 'createdDateTime': '2020-08-26T16:17:41Z', 'description': 'This library contains items that have been modified or deleted but must remain available due to eDiscovery holds. Items cannot be modified...
...

因此,我传递给权限请求的站点 ID 必须是正确的。那么这是错误的端点吗?或者,Graph API 是否缺少此功能,而我唯一的解决方案是通过 SP Powershell 模块?

我试过 API 的 v1.0beta 版本。

谢谢!

根据 this 它看起来像是 Graph API 中的错误。