Hi @_-IJ-_ ,
Thanks for confirming that the sample meets your requirements. I am adding a summarized answer.
Issue:
An example is needed for creating an access review for an Azure AD group and specifying the group.
Example/Resolution:
To specify the group, you need to copy the group ID and include it in the scopes (Query = "/groups/eb75ccd2-59ef-48b7-8f76-cc3f33f899f4"
). The documentation has an example here that creates an access review for a group.
Import-Module Microsoft.Graph.Identity.Governance
$params = @{
DisplayName = "One-time self-review for members of Building security"
DescriptionForAdmins = "One-time self-review for members of Building security"
DescriptionForReviewers = "One-time self-review for members of Building security"
Scope = @{
Query = "/groups/eb75ccd2-59ef-48b7-8f76-cc3f33f899f4/transitiveMembers"
QueryType = "MicrosoftGraph"
}
InstanceEnumerationScope = @{
Query = "/groups/eb75ccd2-59ef-48b7-8f76-cc3f33f899f4"
QueryType = "MicrosoftGraph"
}
Settings = @{
MailNotificationsEnabled = $true
ReminderNotificationsEnabled = $true
JustificationRequiredOnApproval = $true
DefaultDecisionEnabled = $true
DefaultDecision = "Deny"
InstanceDurationInDays = 5
AutoApplyDecisionsEnabled = $true
RecommendationsEnabled = $true
Recurrence = @{
Pattern = $null
Range = @{
Type = "numbered"
NumberOfOccurrences = 0
RecurrenceTimeZone = $null
StartDate = "2022-02-11"
EndDate = "2022-02-16"
}
}
}
}
New-MgIdentityGovernanceAccessReviewDefinition -BodyParameter $params
I believe [GroupId <String>]: key: id of group
can also be specified as in this example.
-
If the information helped you, please *Accept the answer**. This will help us and other members of the community who might be researching similar information.