Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
EntitlementManagement.ReadWrite.All
No disponible.
Delegado (cuenta personal de Microsoft)
No admitida.
No admitida.
Aplicación
EntitlementManagement.ReadWrite.All
No disponible.
Solicitud HTTP
POST /identityGovernance/entitlementManagement/connectedOrganizations
Colección con un elemento, el origen de identidad inicial de esta organización conectada.
state
connectedOrganizationState
El estado de una organización conectada define si las directivas de asignación con el tipo AllConfiguredConnectedOrganizationSubjects de ámbito del solicitante son aplicables o no. Los valores posibles son configured y proposed.
Respuesta
Si se ejecuta correctamente, este método devuelve un 201 Created código de respuesta y un nuevo objeto connectedOrganization en el cuerpo de la respuesta.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ConnectedOrganization
{
DisplayName = "Connected organization name",
Description = "Connected organization description",
IdentitySources = new List<IdentitySource>
{
new DomainIdentitySource
{
OdataType = "#microsoft.graph.domainIdentitySource",
DomainName = "example.com",
DisplayName = "example.com",
},
},
State = ConnectedOrganizationState.Proposed,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.ConnectedOrganizations.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ConnectedOrganization connectedOrganization = new ConnectedOrganization();
connectedOrganization.setDisplayName("Connected organization name");
connectedOrganization.setDescription("Connected organization description");
LinkedList<IdentitySource> identitySources = new LinkedList<IdentitySource>();
DomainIdentitySource identitySource = new DomainIdentitySource();
identitySource.setOdataType("#microsoft.graph.domainIdentitySource");
identitySource.setDomainName("example.com");
identitySource.setDisplayName("example.com");
identitySources.add(identitySource);
connectedOrganization.setIdentitySources(identitySources);
connectedOrganization.setState(ConnectedOrganizationState.Proposed);
ConnectedOrganization result = graphClient.identityGovernance().entitlementManagement().connectedOrganizations().post(connectedOrganization);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.connected_organization import ConnectedOrganization
from msgraph.generated.models.identity_source import IdentitySource
from msgraph.generated.models.domain_identity_source import DomainIdentitySource
from msgraph.generated.models.connected_organization_state import ConnectedOrganizationState
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ConnectedOrganization(
display_name = "Connected organization name",
description = "Connected organization description",
identity_sources = [
DomainIdentitySource(
odata_type = "#microsoft.graph.domainIdentitySource",
domain_name = "example.com",
display_name = "example.com",
),
],
state = ConnectedOrganizationState.Proposed,
)
result = await graph_client.identity_governance.entitlement_management.connected_organizations.post(request_body)
Ejemplo 2: Creación de una organización conectada con un origen de identidad basado en un identificador de inquilino
En este ejemplo se muestra cómo crear una organización conectada con un origen de identidad basado en un identificador de inquilino. El identificador de inquilino se puede encontrar, por el nombre de dominio, mediante la llamada tenantRelationship: findTenantInformationByDomainName .
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new ConnectedOrganization
{
DisplayName = "Connected organization name",
Description = "Connected organization description",
IdentitySources = new List<IdentitySource>
{
new AzureActiveDirectoryTenant
{
OdataType = "#microsoft.graph.azureActiveDirectoryTenant",
DisplayName = "Contoso",
TenantId = "aaaabbbb-0000-cccc-1111-dddd2222eeee",
},
},
State = ConnectedOrganizationState.Proposed,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.ConnectedOrganizations.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ConnectedOrganization connectedOrganization = new ConnectedOrganization();
connectedOrganization.setDisplayName("Connected organization name");
connectedOrganization.setDescription("Connected organization description");
LinkedList<IdentitySource> identitySources = new LinkedList<IdentitySource>();
AzureActiveDirectoryTenant identitySource = new AzureActiveDirectoryTenant();
identitySource.setOdataType("#microsoft.graph.azureActiveDirectoryTenant");
identitySource.setDisplayName("Contoso");
identitySource.setTenantId("aaaabbbb-0000-cccc-1111-dddd2222eeee");
identitySources.add(identitySource);
connectedOrganization.setIdentitySources(identitySources);
connectedOrganization.setState(ConnectedOrganizationState.Proposed);
ConnectedOrganization result = graphClient.identityGovernance().entitlementManagement().connectedOrganizations().post(connectedOrganization);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.connected_organization import ConnectedOrganization
from msgraph_beta.generated.models.identity_source import IdentitySource
from msgraph_beta.generated.models.azure_active_directory_tenant import AzureActiveDirectoryTenant
from msgraph_beta.generated.models.connected_organization_state import ConnectedOrganizationState
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ConnectedOrganization(
display_name = "Connected organization name",
description = "Connected organization description",
identity_sources = [
AzureActiveDirectoryTenant(
odata_type = "#microsoft.graph.azureActiveDirectoryTenant",
display_name = "Contoso",
tenant_id = "aaaabbbb-0000-cccc-1111-dddd2222eeee",
),
],
state = ConnectedOrganizationState.Proposed,
)
result = await graph_client.identity_governance.entitlement_management.connected_organizations.post(request_body)