Collection of Powershell scripts for automating processes in Access Reviews, such as review creation
- 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:
Note: For running UpdateAzureResourceReviewsFromMonthlyToQuarterly.ps1
you need to be an owner of a subscription you are modifying
- 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.
- Ensure you follow the prerequisites to get the correct Graph permissions.
- Run the
BulkReview/Setup.ps1
script first to install the required modules - Run the
GetAllMultiStageReviewDecisionsByNameIntoCsv.ps1
,GetAllActiveSingleStageReviewsByName.ps1
, orGetAllActiveELMReviews.ps1
script depending on which review type you are reviewing- You don't need to pass review names in quotes
- Review the contents of the output file:
AccessReviewPendingDecisions.csv
- Add
Approve
,Deny
, orRecommendation
to take the recommendations- Add a
Justification
if applicable to the rows you are reviewing
- Add a
- Run the
MakeDecision.ps1
and pass in the path to theAccessReviewPendingDecisions.csv
file, just pass inAccessReviewPendingDecisions.csv
if running the Get decisons from the same folder
- 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