Blog链接:https://blog.51cto.com/13969817
很多企业为了确保档案安全和合规,都希望可以构建一个自定义的应用程序,将档案放置在特定的私有频道中,或者在私有频道中执行eDiscovery或者Compliance检测,这种情况下,作为IT Admin,你需要查询每个private channel以及它们各自唯一的SharePoint Site Collection。
有些朋友可能会说,可以到SharePoint Center Admin的Active Site中去获取Teams Site URL就可以了,这里跟大家说明一下,Private Channel不同于General Channel和Standard Channel,当用户新建一个Private Channel之后,后台自动新建一个独立于Teams Site的另一个Site Collection,URL是Teams Site + Private Channel Name组成,这样可以单独给该Site Collection授权少部分Group member,同时这种Site Collection在Active Site 列表中是看不到的,隐藏的,那么该如何获取Private Channel和其Site Collection呢?
解决方案:管理员可以使用Graph API命令来查询这些URL。
· 使用以下代码获取给定Team的私有频道ID列表,其中Group_ID是Team Group的组ID,可以在Azure AD中获取到。
请求:
GET https://graph.microsoft.com/beta/teams/<group_id>/channels?$filter=membershipType eq 'private'
响应:
HTTP/1.1 200 OK
Content-type: application/json
Content-length:
{
"value": [
{
"description": "description-value",
"displayName": "display-name-value",
"id": "channel_id",
"membershipType": "membership-type-value",
"isFavoriteByDefault": false,
"webUrl": "webUrl-value",
"email": "email-value"
}
]
}
· 若要获取SharePoint的每个私有频道的URL,使用如下示例代码,其中channel_id<>是频道ID
请求:
GET https://graph.microsoft.com/beta/teams/<group_id>/channels/<channel_id>/filesFolder
响应:
HTTP/1.1 200 OK
Content-type: application/json
Content-length:
{
"value": [
{
"description": "description-value",
"displayName": "display-name-value",
"id": "channel_id",
"membershipType": "membership-type-value",
"isFavoriteByDefault": false,
"webUrl": "webUrl-value",
"email": "email-value"
}
]
}
谢谢大家阅读,若有疑问,欢迎线下讨论。