【问题标题】:Azure - how to find permissions at a subscription level?Azure - 如何在订阅级别查找权限?
【发布时间】:2018-12-04 20:34:48
【问题描述】:

有一个 EA,其下方附加了数百个小订阅。 我正在尝试找到一个脚本,该脚本将列出每个订阅的“所有者”的所有电子邮件地址(用户帐户登录)。

例如:

**Subscription A owners**  
abcdefg@company.com  
defgh@company.com  
ijklmno@company.com

**Subscription B owners**  
defgh@company.com  
test@company.com

**Subscription C owners**  
abcdefg@company.com

【问题讨论】:

标签: azure powershell azure-active-directory


【解决方案1】:

尝试下面的命令,它应该可以工作。

$subscriptions = Get-AzureRmSubscription 
foreach ($sub in $subscriptions)
{
    Set-AzureRmContext -SubscriptionId $sub.Id
    Write-Output ("**Subscription " + $sub.Name + " owners**")
    (Get-AzureRmRoleAssignment -RoleDefinitionName "Owner").SignInName 
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-27
    • 1970-01-01
    • 1970-01-01
    • 2016-02-10
    • 1970-01-01
    • 2021-05-24
    • 2021-09-11
    相关资源
    最近更新 更多