0
点赞
收藏
分享

微信扫一扫

Microsoft 365 解决方案:为Site Collections添加用户和组,授权失败

Blog链接:​https://blog.51cto.com/13969817

今天在批量为Site Collections添加用户和组权限的时候,遇到如下错误:

Microsoft 365 解决方案:为Site Collections添加用户和组,授权失败_Powershell

因为调用Powershell命令的用户具有Global Admin的权限,排查了好多原因,重新执行命令

PS C:\Users\Byron> Install-Module -Name Microsoft.Online.SharePoint.PowerShell
PS C:\Users\Byron> Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
PS C:\Users\Byron> Connect-SPOService -Url https://mvptrainingcn-admin.sharepoint.com
PS C:\Users\Byron> Connect-SPOService -Credential $creds -Url https://mvptrainingcn-admin.sharepoint.com -ModernAuth $true -AuthenticationUrl https://login.microsoftonline.com/organizations
PS C:\Users\Byron> c:\UsersAndGroups.ps1

仍旧遇到问题,如下所示:

Microsoft 365 解决方案:为Site Collections添加用户和组,授权失败_Powershell_02

后来检查了下用户权限,发现即便具备Global Admin的权限,也不能执行该命令,需要将其对Site Collections具备管理员的权限,才可以执行该命令,添加管理员权限之后,如下所示:

Microsoft 365 解决方案:为Site Collections添加用户和组,授权失败_Powershell_03

再次执行命令,问题解决,如下所示:

Microsoft 365 解决方案:为Site Collections添加用户和组,授权失败_添加用户_04

小结:想用Global Admin用户添加Group和User以及授权权限,必须确保用户有Site Collections Admin的权限,否则会失败。

举报

相关推荐

0 条评论