Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Permet aux réviseurs d’examiner tous les objets accessReviewInstanceDecisionItem dans des lots à l’aide de principalId, resourceId ou aucun des deux.
Dans les scénarios délégués avec des comptes professionnels ou scolaires, l’utilisateur connecté doit se voir attribuer un rôle Microsoft Entra pris en charge ou un rôle personnalisé avec une autorisation de rôle prise en charge. Les rôles les moins privilégiés suivants sont pris en charge pour cette opération.
Pour écrire des révisions d’accès d’un groupe ou d’une application : Administrateur d’utilisateurs, Administrateur de gouvernance des identités
Pour écrire des révisions d’accès d’un rôle Microsoft Entra : Administrateur de gouvernance des identités, Administrateur de rôle privilégié
Requête HTTP
POST /me/pendingAccessReviewInstances/{accessReviewInstanceId}/batchRecordDecisions
Dans le corps de la demande, fournissez une représentation JSON des paramètres.
Le tableau suivant indique les paramètres utilisables avec cette action.
Paramètre
Type
Description
décision
String
Décision d’accès pour l’entité en cours de révision. Les valeurs possibles sont les suivantes : Approve, Deny, NotReviewed, DontKnow. Obligatoire.
justification
String
Contexte de la révision fournie aux administrateurs. Obligatoire si justificationRequiredOnApproval se trouve True sur accessReviewScheduleDefinition.
principalId
String
S’il est fourni, tous les accessReviewInstanceDecisionItems avec principalId correspondant seront examinés dans ce lot. S’il n’est pas fourni, tous les principalIds sont examinés .
resourceId
String
S’il est fourni, tous les accessReviewInstanceDecisionItems avec resourceId correspondant seront examinés dans ce lot. S’il n’est pas fourni, tous les resourceIds sont examinés .
Réponse
Si elle réussit, cette action renvoie un code de réponse 204 No Content.
POST https://graph.microsoft.com/beta/me/pendingAccessReviewInstances/{accessReviewInstanceId}/batchRecordDecisions
Content-Type: application/json
{
"decision": "Approve",
"justification": "All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team",
"resourceId": "a5c51e59-3fcd-4a37-87a1-835c0c21488a"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Me.PendingAccessReviewInstances.Item.BatchRecordDecisions;
var requestBody = new BatchRecordDecisionsPostRequestBody
{
Decision = "Approve",
Justification = "All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team",
ResourceId = "a5c51e59-3fcd-4a37-87a1-835c0c21488a",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Me.PendingAccessReviewInstances["{accessReviewInstance-id}"].BatchRecordDecisions.PostAsync(requestBody);
mgc-beta users pending-access-review-instances batch-record-decisions post --user-id {user-id} --access-review-instance-id {accessReviewInstance-id} --body '{\
"decision": "Approve",\
"justification": "All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team",\
"resourceId": "a5c51e59-3fcd-4a37-87a1-835c0c21488a"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
//other-imports
)
requestBody := graphusers.NewItemBatchRecordDecisionsPostRequestBody()
decision := "Approve"
requestBody.SetDecision(&decision)
justification := "All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team"
requestBody.SetJustification(&justification)
resourceId := "a5c51e59-3fcd-4a37-87a1-835c0c21488a"
requestBody.SetResourceId(&resourceId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Me().PendingAccessReviewInstances().ByAccessReviewInstanceId("accessReviewInstance-id").BatchRecordDecisions().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.users.item.pendingaccessreviewinstances.item.batchrecorddecisions.BatchRecordDecisionsPostRequestBody batchRecordDecisionsPostRequestBody = new com.microsoft.graph.beta.users.item.pendingaccessreviewinstances.item.batchrecorddecisions.BatchRecordDecisionsPostRequestBody();
batchRecordDecisionsPostRequestBody.setDecision("Approve");
batchRecordDecisionsPostRequestBody.setJustification("All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team");
batchRecordDecisionsPostRequestBody.setResourceId("a5c51e59-3fcd-4a37-87a1-835c0c21488a");
graphClient.me().pendingAccessReviewInstances().byAccessReviewInstanceId("{accessReviewInstance-id}").batchRecordDecisions().post(batchRecordDecisionsPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const batchRecordDecisions = {
decision: 'Approve',
justification: 'All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team',
resourceId: 'a5c51e59-3fcd-4a37-87a1-835c0c21488a'
};
await client.api('/me/pendingAccessReviewInstances/{accessReviewInstanceId}/batchRecordDecisions')
.version('beta')
.post(batchRecordDecisions);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\PendingAccessReviewInstances\Item\BatchRecordDecisions\BatchRecordDecisionsPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new BatchRecordDecisionsPostRequestBody();
$requestBody->setDecision('Approve');
$requestBody->setJustification('All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team');
$requestBody->setResourceId('a5c51e59-3fcd-4a37-87a1-835c0c21488a');
$graphServiceClient->me()->pendingAccessReviewInstances()->byAccessReviewInstanceId('accessReviewInstance-id')->batchRecordDecisions()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Users.Actions
$params = @{
decision = "Approve"
justification = "All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team"
resourceId = "a5c51e59-3fcd-4a37-87a1-835c0c21488a"
}
# A UPN can also be used as -UserId.
Invoke-MgBetaBatchUserPendingAccessReviewInstanceRecordDecision -UserId $userId -AccessReviewInstanceId $accessReviewInstanceId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.users.item.pendingaccessreviewinstances.item.batch_record_decisions.batch_record_decisions_post_request_body import BatchRecordDecisionsPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = BatchRecordDecisionsPostRequestBody(
decision = "Approve",
justification = "All principals with access need continued access to the resource (Marketing Group) as all the principals are on the marketing team",
resource_id = "a5c51e59-3fcd-4a37-87a1-835c0c21488a",
)
await graph_client.me.pending_access_review_instances.by_access_review_instance_id('accessReviewInstance-id').batch_record_decisions.post(request_body)