首页 > 解决方案 > List of all Resources in my Azure Subscription + IAM Access Control Credentials

问题描述

I need to export all the Resources from my Azure subscription and i got the command for this:

Get-AzureRmResource | Export-CSV C:\temp\azure-resources.csv

But I want to export all IAM Access Control Information from each Resource separately, to see all the user that has access to this resource and all the permissions.

Does someone have an idea how to do it with PS commands?

标签: azurepowershellcommandazure-active-directory

解决方案


尝试使用以下命令将每个资源 IAM 信息(角色分配)导出到 CSV。

$resource = (Get-AzureRmResource | Select-Object ResourceId).ResourceId 

foreach($item in $resource){
    $role += Get-AzureRmRoleAssignment -Scope $item 
}

$role | Export-CSV C:\Users\joyw\Desktop\test.csv

在此处输入图像描述


推荐阅读