How to run script to check access for all associates?

Santosh Sahoo 0 Reputation points
2024-03-18T17:30:24.3+00:00

I need to check owner access for all associates for all subscription for azure. How to run script in azure?

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,504 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. dashanan13 930 Reputation points
    2024-04-13T23:11:50.53+00:00

    Hei @Santosh Sahoo ,

    As i understand you want to check the role assignment for All subscriptions.

    Steps:

    1. Get all subscriptions and store in variable:
    $subs =Get-AzSubscription
    
    1. Iterate over this list and for each item, get role assignments:
    Get-AzRoleAssignment -Scope /subscriptions/xxxxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxxxxxxx | | Where-Object {$_.Scope -eq 'Owner'}
    

    Please mark this as answer if it helped

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.