Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Erstellen Sie ein neues connectedOrganization-Objekt .
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
EntitlementManagement.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
EntitlementManagement.ReadWrite.All |
Nicht verfügbar. |
Tipp
Für den delegierten Zugriff mit Geschäfts-, Schul- oder Unikonten muss dem angemeldeten Benutzer eine Administratorrolle mit unterstützten Rollenberechtigungen über eine der folgenden Optionen zugewiesen werden:
- Eine Microsoft Entra-Rolle, bei der die Rolle "Identity Governance-Administrator" die am wenigsten privilegierte Rolle ist.
Dies ist die Option mit den geringsten Berechtigungen.
In reinen App-Szenarien kann der aufrufenden App anstelle der EntitlementManagement.ReadWrite.All Anwendungsberechtigung eine der oben genannten unterstützten Rollen zugewiesen werden. Die Rolle des Identity Governance-Administrators ist weniger privilegiert als die EntitlementManagement.ReadWrite.All Anwendungsberechtigung.
Weitere Informationen finden Sie unter Delegierung und Rollen in der Berechtigungsverwaltung und Delegieren der Zugriffsgovernance an Zugriffspaket-Manager in der Berechtigungsverwaltung.
HTTP-Anforderung
POST /identityGovernance/entitlementManagement/connectedOrganizations
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des connectedOrganization-Objekts an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die beim Erstellen der connectedOrganization erforderlich sind.
| Eigenschaft |
Typ |
Beschreibung |
| displayName |
Zeichenfolge |
Der Name der verbundenen organization. |
| description |
Zeichenfolge |
Die Beschreibung der verbundenen organization. |
| identitySources |
identitySource-Sammlung |
Eine Sammlung mit einem Element, der anfänglichen Identitätsquelle in dieser verbundenen organization. |
| state |
connectedOrganizationState |
Der Zustand einer verbundenen organization definiert, ob Zuweisungsrichtlinien mit dem Typ AllConfiguredConnectedOrganizationSubjects "Anforderer" anwendbar sind oder nicht. Die möglichen Werte sind: configured, proposed. |
Das einzelne Element der identitySources-Auflistung sollte entweder vom Typ domainIdentitySource oder externalDomainFederation sein. Wenn der Aufrufer eine domainIdentitySource bereitstellt, der Aufruf erfolgreich ist und die Domäne einer registrierten Domäne eines Microsoft Entra-Mandanten entspricht, verfügt die resultierende connectedOrganization, die erstellt wird, über eine identitySources-Auflistung, die ein einzelnes Mitglied des azureActiveDirectoryTenant-Typs enthält.
Antwort
Bei erfolgreicher Ausführung gibt diese Methode einen 201 Created Antwortcode und ein neues connectedOrganization-Objekt im Antworttext zurück.
Beispiele
Beispiel 1: Erstellen einer verbundenen organization
Anforderung
POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/connectedOrganizations/
Content-Type: application/json
{
"displayName":"Connected organization name",
"description":"Connected organization description",
"identitySources": [
{
"@odata.type": "#microsoft.graph.domainIdentitySource",
"domainName": "example.com",
"displayName": "example.com"
}
],
"state":"proposed"
}
// 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 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 major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewConnectedOrganization()
displayName := "Connected organization name"
requestBody.SetDisplayName(&displayName)
description := "Connected organization description"
requestBody.SetDescription(&description)
identitySource := graphmodels.NewDomainIdentitySource()
domainName := "example.com"
identitySource.SetDomainName(&domainName)
displayName := "example.com"
identitySource.SetDisplayName(&displayName)
identitySources := []graphmodels.IdentitySourceable {
identitySource,
}
requestBody.SetIdentitySources(identitySources)
state := graphmodels.PROPOSED_CONNECTEDORGANIZATIONSTATE
requestBody.SetState(&state)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
connectedOrganizations, err := graphClient.IdentityGovernance().EntitlementManagement().ConnectedOrganizations().Post(context.Background(), requestBody, nil)
// 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);
const options = {
authProvider,
};
const client = Client.init(options);
const connectedOrganization = {
displayName: 'Connected organization name',
description: 'Connected organization description',
identitySources: [
{
'@odata.type': '#microsoft.graph.domainIdentitySource',
domainName: 'example.com',
displayName: 'example.com'
}
],
state: 'proposed'
};
await client.api('/identityGovernance/entitlementManagement/connectedOrganizations/')
.version('beta')
.post(connectedOrganization);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\ConnectedOrganization;
use Microsoft\Graph\Beta\Generated\Models\IdentitySource;
use Microsoft\Graph\Beta\Generated\Models\DomainIdentitySource;
use Microsoft\Graph\Beta\Generated\Models\ConnectedOrganizationState;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ConnectedOrganization();
$requestBody->setDisplayName('Connected organization name');
$requestBody->setDescription('Connected organization description');
$identitySourcesIdentitySource1 = new DomainIdentitySource();
$identitySourcesIdentitySource1->setOdataType('#microsoft.graph.domainIdentitySource');
$identitySourcesIdentitySource1->setDomainName('example.com');
$identitySourcesIdentitySource1->setDisplayName('example.com');
$identitySourcesArray []= $identitySourcesIdentitySource1;
$requestBody->setIdentitySources($identitySourcesArray);
$requestBody->setState(new ConnectedOrganizationState('proposed'));
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->connectedOrganizations()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
$params = @{
displayName = "Connected organization name"
description = "Connected organization description"
identitySources = @(
@{
"@odata.type" = "#microsoft.graph.domainIdentitySource"
domainName = "example.com"
displayName = "example.com"
}
)
state = "proposed"
}
New-MgBetaEntitlementManagementConnectedOrganization -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.models.connected_organization import ConnectedOrganization
from msgraph_beta.generated.models.identity_source import IdentitySource
from msgraph_beta.generated.models.domain_identity_source import DomainIdentitySource
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 = [
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)
Antwort
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-type: application/json
{
"id": "006111db-0810-4494-a6df-904d368bd81b",
"displayName":"Connected organization name",
"description":"Connected organization description",
"createdBy": "admin@contoso.com",
"createdDateTime": "2020-06-08T20:13:53.7099947Z",
"modifiedBy": "admin@contoso.com",
"modifiedDateTime": "2020-06-08T20:13:53.7099947Z",
"state":"proposed"
}
Beispiel 2: Erstellen einer verbundenen organization mit einer identitySource basierend auf einer Mandanten-ID
Dieses Beispiel zeigt das Erstellen einer verbundenen organization mit einer Identitätsquelle basierend auf einer Mandanten-ID. Die Mandanten-ID kann anhand des Domänennamens mithilfe des Aufrufs tenantRelationship: findTenantInformationByDomainName gefunden werden.
Anforderung
POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/connectedOrganizations/
Content-Type: application/json
{
"displayName":"Connected organization name",
"description":"Connected organization description",
"identitySources": [
{
"@odata.type": "#microsoft.graph.azureActiveDirectoryTenant",
"displayName": "Contoso",
"tenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee"
}
],
"state":"proposed"
}
// 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 major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewConnectedOrganization()
displayName := "Connected organization name"
requestBody.SetDisplayName(&displayName)
description := "Connected organization description"
requestBody.SetDescription(&description)
identitySource := graphmodels.NewAzureActiveDirectoryTenant()
displayName := "Contoso"
identitySource.SetDisplayName(&displayName)
tenantId := "aaaabbbb-0000-cccc-1111-dddd2222eeee"
identitySource.SetTenantId(&tenantId)
identitySources := []graphmodels.IdentitySourceable {
identitySource,
}
requestBody.SetIdentitySources(identitySources)
state := graphmodels.PROPOSED_CONNECTEDORGANIZATIONSTATE
requestBody.SetState(&state)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
connectedOrganizations, err := graphClient.IdentityGovernance().EntitlementManagement().ConnectedOrganizations().Post(context.Background(), requestBody, nil)
// 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);
const options = {
authProvider,
};
const client = Client.init(options);
const connectedOrganization = {
displayName: 'Connected organization name',
description: 'Connected organization description',
identitySources: [
{
'@odata.type': '#microsoft.graph.azureActiveDirectoryTenant',
displayName: 'Contoso',
tenantId: 'aaaabbbb-0000-cccc-1111-dddd2222eeee'
}
],
state: 'proposed'
};
await client.api('/identityGovernance/entitlementManagement/connectedOrganizations/')
.version('beta')
.post(connectedOrganization);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\ConnectedOrganization;
use Microsoft\Graph\Beta\Generated\Models\IdentitySource;
use Microsoft\Graph\Beta\Generated\Models\AzureActiveDirectoryTenant;
use Microsoft\Graph\Beta\Generated\Models\ConnectedOrganizationState;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ConnectedOrganization();
$requestBody->setDisplayName('Connected organization name');
$requestBody->setDescription('Connected organization description');
$identitySourcesIdentitySource1 = new AzureActiveDirectoryTenant();
$identitySourcesIdentitySource1->setOdataType('#microsoft.graph.azureActiveDirectoryTenant');
$identitySourcesIdentitySource1->setDisplayName('Contoso');
$identitySourcesIdentitySource1->setTenantId('aaaabbbb-0000-cccc-1111-dddd2222eeee');
$identitySourcesArray []= $identitySourcesIdentitySource1;
$requestBody->setIdentitySources($identitySourcesArray);
$requestBody->setState(new ConnectedOrganizationState('proposed'));
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->connectedOrganizations()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
$params = @{
displayName = "Connected organization name"
description = "Connected organization description"
identitySources = @(
@{
"@odata.type" = "#microsoft.graph.azureActiveDirectoryTenant"
displayName = "Contoso"
tenantId = "aaaabbbb-0000-cccc-1111-dddd2222eeee"
}
)
state = "proposed"
}
New-MgBetaEntitlementManagementConnectedOrganization -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.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)
Antwort
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/entitlementManagement/connectedOrganizations/$entity",
"id": "922c86cf-65b8-4d94-b6a6-477dde331c7b",
"displayName": "Connected organization name",
"description": "Connected organization description",
"createdDateTime": "2024-10-29T21:55:39.6051923Z",
"modifiedDateTime": "2024-10-29T21:55:39.6051923Z",
"state": "proposed",
"identitySources": []
}