New-MgAccessReviewInstanceReviewer

Melmix 0 Reputation points
2023-06-23T10:13:13.5566667+00:00

Hi

For some reason Microsoft has not built in functionality which allows access reviews performed by managers to fall back to the manager's manager. We need this functionality, so I'm trying to use powershell to add an extra reviewer to the current instance review of an ongoing series, if the review has been in progress for more than 14 days and the direct manager has not made any decisions. I've got most of the script sorted, but I can't get this part working and was hoping someone would be able to assist:

$ManagersManager = (Get-MgUserManager -UserId $ReviewerUPN).Id

	Id = "$ManagersManager"
}

New-MgAccessReviewInstanceReviewer -AccessReviewId $accessReview.Id -AccessReviewId1 $AccessReviewInstanceLatest.Id -BodyParameter $params

I get the error:

New-MgAccessReviewInstanceReviewer : No HTTP resource was found that matches the request URI 'https://api.accessreviews.identitygovernance.azure.com/accessReviews/v2.0/accessReviews('[Unique ID for the review series]
')/instances('[Unique ID for the review instance]')/reviewers?ring=2'.

It works fine if I just want to add the reviewer to the entire series, but not the current instance of the review:

$ManagersManager = (Get-MgUserManager -UserId $ReviewerUPN).Id

$params = @{
	Id = "$ManagersManager"
}

New-MgAccessReviewReviewer -AccessReviewId $accessReview.Id -BodyParameter $params

I have verified the ID for the instance is correct.

Various links:

https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.governance/new-mgaccessreviewinstancereviewer?view=graph-powershell-beta

https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.governance/new-mgaccessreviewreviewer?view=graph-powershell-beta

Any suggestions would be greatly appreciated. Thank you!

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Melmix 0 Reputation points
    2023-06-23T11:41:07.83+00:00

    I figured out the solution. Just use New-MgAccessReviewReviewer but with the Id of the instance rather than the series

    $ManagersManager = (Get-MgUserManager -UserId $ReviewerUPN).Id
    
    $params = @{
    	Id = "$ManagersManager"
    }
    
    New-MgAccessReviewReviewer -AccessReviewId $AccessReviewInstanceLatest.Id -BodyParameter $params
    
    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.