Created
June 25, 2019 00:38
-
-
Save brootware/83c7f473e3f65d8d977020e035e27c17 to your computer and use it in GitHub Desktop.
exports role assignments in JSON format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get Resources | |
$Resources = Get-AzureRmRoleAssignment | |
#Get Resource Data | |
$Output = $Resources| ForEach-Object { | |
[PSCustomObject]@{ | |
"Name" = $_.DisplayName | |
"ObjectId" = $_.ObjectId | |
"ObjectType" = $_.ObjectType | |
"RoleAssignmentId" = $_.RoleAssignmentId | |
"RoleDefinitionName" = $_.RoleDefinitionName | |
"RoleDefinitionId" = $_.RoleDefinitionId | |
"Scope" = $_.Scope | |
"SignInName" = $_.SignInName | |
"CanDelegate" = $_.CanDelegate | |
} | |
} | |
#Output Resource Data | |
$Output | ConvertTo-Json -Depth 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment