【问题标题】:PnP Powershell Add-PnPOffice365GroupToSite Authorization_RequestDenied Azure RunbookPnP Powershell Add-PnPOffice365GroupToSite Authorization_RequestDenied Azure Runbook
【发布时间】:2020-05-21 11:01:38
【问题描述】:

我们正在使用带有 PnP PowerShell 的 Azure Runbook 来自动预配 SharePoint Online 和 O365 组。

要通过 PnP PowerShell 进行连接和身份验证,我们使用已分配给 Azure 运行方式帐户的 AppId 和 AppSecret。

通过传递 AppId 和 AppSecret 的 Connect-PnPOnline 命令连接到 PnP Powershell 效果很好。

然后我们可以使用New-PnPTenantSite 创建一个新站点,但是当我们使用Add-PnPOffice365GroupToSite 创建一个组时,我们会收到以下错误。

{"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to 
complete the operation."},"requestId":"fd2a5b37-98ea-40ab-bf39-5db8fafe9057","date":"2020-02-05T13:04:08"}}
At line:75 char:1
+ Add-PnPOffice365GroupToSite -Url "$siteFullUrl" -Alias "$MailboxName" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Add-PnPOffice365GroupToSite], ServerException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Admin.AddOffice365GroupToSite

我们已通过 /_layouts/AppInv.aspx 页面授予 SharePoint 租户管理权限,并且还提供了对 Azure 中 AppRegistration 的直接 API 访问权限。我们已分配与组、站点和 AD 相关的大部分权限,但仍会收到上述错误。

是否有人知道我们需要为此应用注册分配哪些 API 权限以允许其使用此方法创建 office 365 组?

上面的截图显示了分配给应用注册的 API 权限。

【问题讨论】:

  • 能否展示一下您的应用注册 API 权限截图?
  • @JoyWang 感谢 Joy 的提问。我添加了 API 权限的屏幕截图。

标签: azure powershell sharepoint runbook


【解决方案1】:

事实证明,某些操作需要用户交互来进行审计——组创建就是其中之一。

在此处参考 Andrew Connell 的回答 -> https://github.com/SharePoint/sp-dev-docs/issues/3799

【讨论】:

    猜你喜欢
    • 2018-06-16
    • 2022-09-25
    • 2019-05-05
    • 2021-07-17
    • 2022-11-11
    • 2018-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多