azure - 获取 PnPUnifiedGroup:代码:Authorization_RequestDenied
问题描述
如何使用此命令从图形中获取统一组
$group = Get-PnPUnifiedGroup -Identity $sitetitle
然后我得到这个错误:
获取 PnPUnifiedGroup:代码:Authorization_RequestDenied
尝试与租户用户连接:
## know that this is not going to work
Connect-PnPOnline "https://$tenant-admin.sharepoint.com" -Credentia $cred
并使用具有所有图形权限的 AADDomain
Connect-PnPOnline -AppId $appid -AppSecret $appsecret -AADDomain "$tenant.onmicrosoft.com"
也尝试过证书..
Connect-PnPOnline -CertificatePath .\xxxxxcertkeyname.pfx -Tenant 'xxxxxxxxxxx.onmicrosoft.com' -ClientId 'xxxxxxx-xxxx-xxx-xxx-xxxxxx' -Url 'https://xxxxxxxx-admin.sharepoint.com'
但是不能上班
解决方案
你应该连接到一个特定的范围
Connect-PnPOnline "https://$tenant-admin.sharepoint.com" -Scope "Group.Read.All" -Credentia $cred
-Scope "Group.Read.All"
或者-Scope "Group.ReadWrite.All", "Directory.ReadWrite.All"
如果您打算更改任何组
图 api 的可用权限 https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/concepts/permissions_reference.md
推荐阅读
- sql - 将 2 个查询合二为一(根据其他选择进行选择)
- jhipster - 如何在 JHipster 5 中显示图标?
- react-native - 如何将 react-native 从 0.56.0 降级到 0.55.4 版本?
- spring - Spring Boot 应用程序中的背压
- c# - asp.net | 如何将数据添加到数据库的下一个 ID?
- network-programming - 不必要的网络命令
- sql-server - 全文索引不适用于单个单词?
- python - 我想将“文件名”作为参数传递给其他函数调用,但总是返回“无”作为值
- rest - 如何在 Visual Basic 6 (vb6) 中使用 TLS 1.2 - REST
- python - 工作线程阻塞 GUI 中的 QTimer