riskyUser: confirmCompromised
Article
03/02/2023
8 contributors
Feedback
In this article
Namespace: microsoft.graph
Note: The riskyUsers API requires an Azure AD Premium P2 license.
Confirm one or more riskyUser objects as compromised. This action sets the targeted user's risk level to high.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
IdentityRiskyUser.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
IdentityRiskyUser.ReadWrite.All
HTTP request
POST /identityProtection/riskyUsers/confirmCompromised
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, supply JSON representation of the parameters.
The following table shows the parameters that can be used with this action.
Parameter
Type
Description
userIds
String collection
Specify the risky user IDs to dismiss in the request body.
Response
If successful, this action returns a 204 No Content
response code.
Examples
Request
POST https://graph.microsoft.com/v1.0/identityProtection/riskyUsers/confirmCompromised
Content-Type: application/json
{
"userIds": [
"29f270bb-4d23-4f68-8a57-dc73dc0d4caf",
"20f91ec9-d140-4d90-9cd9-f618587a1471"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.IdentityProtection.RiskyUsers.ConfirmCompromised.ConfirmCompromisedPostRequestBody
{
UserIds = new List<string>
{
"29f270bb-4d23-4f68-8a57-dc73dc0d4caf",
"20f91ec9-d140-4d90-9cd9-f618587a1471",
},
};
await graphClient.IdentityProtection.RiskyUsers.ConfirmCompromised.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/IdentityProtection/RiskyUsers/ConfirmCompromised"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewConfirmCompromisedPostRequestBody()
userIds := []string {
"29f270bb-4d23-4f68-8a57-dc73dc0d4caf",
"20f91ec9-d140-4d90-9cd9-f618587a1471",
}
requestBody.SetUserIds(userIds)
graphClient.IdentityProtection().RiskyUsers().ConfirmCompromised().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<String> userIdsList = new LinkedList<String>();
userIdsList.add("29f270bb-4d23-4f68-8a57-dc73dc0d4caf");
userIdsList.add("20f91ec9-d140-4d90-9cd9-f618587a1471");
graphClient.identityProtection().riskyUsers()
.confirmCompromised(RiskyUserConfirmCompromisedParameterSet
.newBuilder()
.withUserIds(userIdsList)
.build())
.buildRequest()
.post();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const confirmCompromised = {
userIds: [
'29f270bb-4d23-4f68-8a57-dc73dc0d4caf',
'20f91ec9-d140-4d90-9cd9-f618587a1471'
]
};
await client.api('/identityProtection/riskyUsers/confirmCompromised')
.post(confirmCompromised);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new ConfirmCompromisedPostRequestBody();
$requestBody->setUserIds(['29f270bb-4d23-4f68-8a57-dc73dc0d4caf', '20f91ec9-d140-4d90-9cd9-f618587a1471', ]);
$graphServiceClient->identityProtection()->riskyUsers()->confirmCompromised()->post($requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
userIds = @(
"29f270bb-4d23-4f68-8a57-dc73dc0d4caf"
"20f91ec9-d140-4d90-9cd9-f618587a1471"
)
}
Confirm-MgRiskyUserCompromised -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
HTTP/1.1 204 No Content