En el cuerpo de la solicitud, proporcione un objeto JSON con los siguientes parámetros.
Parámetro
Tipo
Descripción
ids
Colección string
Colección que contiene los identificadores de objeto de los grupos, unidades administrativas, roles de directorio o identificadores roleTemplate de roles de directorio, en los que se va a comprobar la pertenencia. Puede especificar hasta 20 objetos.
Respuesta
Si se ejecuta correctamente, este método devuelve un 200 OK código de respuesta y un nuevo objeto de colección String en el cuerpo de la respuesta.
Ejemplos
A continuación se muestra un ejemplo de cómo llamar a esta API.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Me.CheckMemberObjects;
var requestBody = new CheckMemberObjectsPostRequestBody
{
Ids = new List<string>
{
"80a963dd-84af-4eb8-b2a6-781e444d4fb0",
"62e90394-69f5-4237-9190-012177145e10",
"86a64f51-3a64-4cc6-a8c8-6b8f000c0f52",
"ac38546e-ddf3-437a-ac5c-27a94cd7a0f1",
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.CheckMemberObjects.PostAsCheckMemberObjectsPostResponseAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
//other-imports
)
requestBody := graphusers.NewItemCheckMemberObjectsPostRequestBody()
ids := []string {
"80a963dd-84af-4eb8-b2a6-781e444d4fb0",
"62e90394-69f5-4237-9190-012177145e10",
"86a64f51-3a64-4cc6-a8c8-6b8f000c0f52",
"ac38546e-ddf3-437a-ac5c-27a94cd7a0f1",
}
requestBody.SetIds(ids)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
checkMemberObjects, err := graphClient.Me().CheckMemberObjects().PostAsCheckMemberObjectsPostResponse(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.users.item.checkmemberobjects.CheckMemberObjectsPostRequestBody checkMemberObjectsPostRequestBody = new com.microsoft.graph.users.item.checkmemberobjects.CheckMemberObjectsPostRequestBody();
LinkedList<String> ids = new LinkedList<String>();
ids.add("80a963dd-84af-4eb8-b2a6-781e444d4fb0");
ids.add("62e90394-69f5-4237-9190-012177145e10");
ids.add("86a64f51-3a64-4cc6-a8c8-6b8f000c0f52");
ids.add("ac38546e-ddf3-437a-ac5c-27a94cd7a0f1");
checkMemberObjectsPostRequestBody.setIds(ids);
var result = graphClient.me().checkMemberObjects().post(checkMemberObjectsPostRequestBody);
Import-Module Microsoft.Graph.Users.Actions
$params = @{
ids = @(
"80a963dd-84af-4eb8-b2a6-781e444d4fb0"
"62e90394-69f5-4237-9190-012177145e10"
"86a64f51-3a64-4cc6-a8c8-6b8f000c0f52"
"ac38546e-ddf3-437a-ac5c-27a94cd7a0f1"
)
}
# A UPN can also be used as -UserId.
Confirm-MgUserMemberObject -UserId $userId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.users.item.check_member_objects.check_member_objects_post_request_body import CheckMemberObjectsPostRequestBody
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CheckMemberObjectsPostRequestBody(
ids = [
"80a963dd-84af-4eb8-b2a6-781e444d4fb0",
"62e90394-69f5-4237-9190-012177145e10",
"86a64f51-3a64-4cc6-a8c8-6b8f000c0f52",
"ac38546e-ddf3-437a-ac5c-27a94cd7a0f1",
],
)
result = await graph_client.me.check_member_objects.post(request_body)