Forum Discussion

notepadapp's avatar
notepadapp
Copper Contributor
Jul 16, 2024

Graph - Access Review

I've been trying to modify my create access review script to include an email address to the NotificationRecipientScope. Need to specify at end of review, send notification to email address removed for privacy reasons.

Does anybody know how to correctly implement this into the current ps params?

 

			additionalNotificationRecipients = @(
            @{
                notificationTemplateType = "CompletedAdditionalRecipients"
                recipients = @(
                    @{
                        "@odata.type" = "#microsoft.graph.accessReviewNotificationRecipientScope"
                        notificationRecipients = @(
                            @{
                                notificationRecipientEmail = "email address removed for privacy reasons"
                            }
                        )
                    }
                )
            }
        )

 

 

  • sdtslmn's avatar
    sdtslmn
    Brass Contributor

    maybe the following can help you 

     

    $notifRecipients = @(
        @{
            notificationTemplateType = "CompletedAdditionalRecipients"
            recipients = @(
                @{
                    "@odata.type" = "#microsoft.graph.accessReviewNotificationRecipientScope"
                    notificationRecipients = @(
                        @{
                            "@odata.type" = "#microsoft.graph.user"
                            emailAddress = "email address removed for privacy reasons"
                        }
                    )
                }
            )
        }
    )
    
    # Example Access Review Creation
    New-AzureADMSAccessReview -ReviewId <ReviewId> -Settings @{
        autoApplyDecisionsEnabled = $false
        instanceDurationInDays = 30
        mailNotificationsEnabled = $true
        recurrenceSettings = @{
            pattern = @{ type = "weekly"; interval = 1 }
            range = @{ type = "endDate"; endDate = "2024-12-31T23:59:59Z" }
        }
        reviewers = @(
            @{ "@odata.type" = "#microsoft.graph.userSet"; id = "<UserId>" }
        )
        additionalNotificationRecipients = $notifRecipients
    }
    • notepadapp's avatar
      notepadapp
      Copper Contributor
      Thanks for your help, unfortunately I get error 400 - bad request.

Resources