![](/img/trans.png)
[英]Azure Automation: Runbook: Get all AAD Group Properties, e.g. the Notes / Info field?
[英]Azure Automation: Runbook, RunAs Account: How to allow access to AAD (e.g. for Get-AzADUser)?
下午好
我為這個問題選擇了stackoverflow,因為可能主要是程序員面臨這個問題:
如果我們調用Get-AzADUser
來獲取 Azure 自動化運行手冊中的所有 AAD 用戶,那么我們會得到: Error 'Insufficient privileges'
# Connect to AAD
$Conn = Get-AutomationConnection -Name AzureRunAsConnection
$account = Connect-AzAccount -ServicePrincipal `
-TenantId $Conn.TenantID `
-ApplicationId $Conn.ApplicationID `
-CertificateThumbprint $Conn.CertificateThumbprint
# Get All AAD Users
$AllADUsers = Get-AzADUser
> Get-AzADUser : Insufficient privileges to complete the operation.
> FullyQualifiedErrorId :
> Microsoft.Azure.Commands.ActiveDirectory.GetAzureADUserCommand
Automation Account
已設置Run as accounts
» Azure Run As Account
(而不是 Azure 經典運行方式帳戶)Azure Run As Account
具有誤導性,它是一個注冊應用程序,可以在 Azure App registrations
中找到» 具有所有權限的自定義角色。
» API 權限:
Microsoft Graph (6)
Delegated Directory.AccessAsUser.All
Delegated Directory.ReadWrite.All
Delegated User.ReadWrite.All
Application Directory.ReadWrite.All
Application User.Export.All
Application User.ReadWrite.All
» 所有 API 權限均授予我們的租戶
不幸的是,我們仍然收到錯誤“權限不足”
非常感謝您的幫助!
親切的問候,托馬斯
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.