Collection of Powershell scripts for automating processes in Access Reviews, such as review creation
- For the script
UpdateAzureResourceReviewsFromMonthlyToQuarterly.ps1
you need to be an owner of a subscription you are modifying
- Getting approved for Access Reviews Graph API permissions:
- The person or app which executes any script for managing/reading Access Reviews or makes the equivalent API calls needs to have the proper Graph permissions for Access Reviews in their tenant.
- Some more information:
- One simple way to add Graph permissions for a user principal is for a tenant admin to grant them permissions via the Portal or Graph Explorer.
- Grant permissions via Graph Explorer:
- In your browser navigate to Graph Explorer
- Log-in as your user who is tenant admin (top right corner)
- Fill out the URL text box with an Access Review’s URL: https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions
- The permissions you require will appear in the box below
- You need these Graph Permissions:
- AccessReview.Read.All
- AccessReview.ReadWrite.All
- Click 'Consent' if you don’t already have the permissions, if it reads 'Unconsent' you already have the permissions.
- Grant permissions via Graph Explorer:
- Run the desired Powershell script like so
.\asdf.ps1
. - You might be prompted for an interactive login as the user you granted permissions to in Prerequisites.
- Powershell script
- Sample execution and output:
- Get a list of review definitions
- List definitions
GET - https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions
- For each definition get a list of instances:
- List instances
GET - https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions/fd3c47e4-c606-472e-b7de-6a217aa68c57/instances
- For each instance get a list of contacted reviewers (reviewers who have been notified to review):
- List contactedReviewers
GET - https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions/fd3c47e4-c606-472e-b7de-6a217aa68c57/instances/fd3c47e4-c606-472e-b7de-6a217aa68c57/contactedReviewers
- For each instance get a list of decision items:
- List decisions
GET - https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions/fd3c47e4-c606-472e-b7de-6a217aa68c57/instances/fd3c47e4-c606-472e-b7de-6a217aa68c57/decisions