如何通过SharePoint REST API/Graph API在SharePoint在Online中找到网站所有者
我正在尝试找到所有被允许在SharePoint Online中访问网站的用户。
我可以使用以下请求通过SharePoint REST API来执行此操作:
https://<tenant>.sharepoint.com/sites/<site>/_api/web/RoleAssignments?$expand=Member/Users,RoleDefinitionBindings
响应包含一些隐藏的技术帐户,已明确授予权限的用户以及成员和所有者的默认SharePoint站点组。 SharePoint站点成员组具有以下登录名:
c:0o.c|federateddirectoryclaimprovider|<UUID>
其中&lt; uuid&gt;
是Azure组的ID。然后,我可以使用图形API解决其成员。但是,这里有一个用户在SharePoint UI中列为网站的所有者。
但是,SharePoint站点所有者组具有以下登录名:
c:0o.c|federateddirectoryclaimprovider|<UUID>_o
其中&lt; uuid&gt;
与以前完全相同。因此,我无法使用图形API解决其成员,因为UUID为我提供了成员组,而包括后缀在内的UUID是无效的组标识符。
此外,SharePoint REST API似乎将该所有者组(以及成员组)视为用户而不是组,因此我也找不到使用此API解决其成员的方法。
那么,如何解决网站所有者的实际用户呢?
非常感谢!
I'm trying to find all users that are permitted to access a site in SharePoint Online.
I can do that via the SharePoint REST API using the following request:
https://<tenant>.sharepoint.com/sites/<site>/_api/web/RoleAssignments?$expand=Member/Users,RoleDefinitionBindings
The response contains some hidden technical accounts, users that have been granted permissions explicitly, and the default SharePoint site groups for members and owners.
The SharePoint site member group is presented with the following LoginName:
c:0o.c|federateddirectoryclaimprovider|<UUID>
Where <UUID>
is the id of an Azure group. I can then resolve its members using the Graph API. However, there is a user missing here that is listed in the SharePoint UI as an owner of the site.
The SharePoint site owner group, however, is presented with the following LoginName:
c:0o.c|federateddirectoryclaimprovider|<UUID>_o
Where <UUID>
is the exact same id as before. So I can't resolve its members using the Graph API as the UUID gives me the member group and the UUID including the suffix is an invalid group identifier.
Furthermore, the SharePoint REST API seems to treat this owner group (as well as the member group) like a user rather than a group, so I couldn't find a way to resolve its members using this API either.
So how can I resolve the actual users that are owners of a site?
Thank you very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那不是那么简单吗?
Isn't it as simple as that?
该解决方案在此处描述: https://lealen.microsoft.com/en-us/sharepoint/modern-ecperience-sharing-permissions#team-site-site-site-site-site-site-permissions-and-findice-365 groups
这意味着您可以通过以下请求检索站点所有者:
The solution is described here: https://learn.microsoft.com/en-us/sharepoint/modern-experience-sharing-permissions#team-site-permissions-and-office-365-groups
Which means you can retrieve the site owners with the following request: