繁体   English   中英

通过 Powershell 将 office365 组添加到 Sharepoint 网站集管理员

[英]adding office365 group to Sharepoint site collection administrators thorugh Powershell

我正在尝试通过 PowerShell 或 API 将 Office 365 组之一添加为 SharePoint 在线站点中的网站集管理员,但我没有得到任何解决方案。 我可以从站点 UI 手动执行此操作,但我想将其自动化,因此寻找 Powershell 或 API。 可以通过 UI 添加

您可以使用 PnP PowerShell cmdlet Add-PnPSiteCollectionAdmin -owners

参考: https://github.com/pnp/powershell/blob/dev/documentation/Add-PnPSiteCollectionAdmin.md

我们需要注意的是,与文档中所说的不同,我们需要使用像i:0#.f|membership|user1@contoso.sharepoint.com user1@contoso.sharepoint.com 这样的LoginName

因此,对于 O365 组,它应类似于c:0o.c|federateddirectoryclaimprovider|<Object ID>

对于安全组,它应类似于c:0t.c|tenant|<Object Id>

您可以在 Azure AD 中获取组的 Object ID。 在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM