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 eine neue mandantenübergreifende Microsoft 365-Funktion für die standardmäßige mandantenübergreifende Zugriffsrichtlinie. Die Eigenschaft @odata.type im Anforderungstext ist erforderlich, um anzugeben, welcher Funktionstyp erstellt werden soll.
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) |
Policy.ReadWrite.CrossTenantCapability |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
Policy.ReadWrite.CrossTenantCapability |
Nicht verfügbar. |
Wichtig
Für den delegierten Zugriff über Geschäfts-, Schul- oder Unikonten, bei denen der angemeldete Benutzer auf einen anderen Benutzer reagiert, muss ihm eine unterstützte Microsoft Entra-Rolle oder eine benutzerdefinierte Rolle zugewiesen werden, die die für diesen Vorgang erforderlichen Berechtigungen gewährt. Die Verwaltung der mandantenübergreifenden Microsoft 365-Funktionen wirkt sich auf die gesamte mandantenübergreifende Zugriffsrichtlinie aus, sodass keine integrierte Rolle mit niedrigeren Berechtigungen alle Funktionen abdeckt. Dieser Vorgang unterstützt die folgenden integrierten Rollen:
- Globaler Administrator – für alle Funktionen erforderlich, da für die Verwaltung der mandantenübergreifenden Zugriffsrichtlinie verzeichnisweite Berechtigungen erforderlich sind.
- Exchange-Administrator – wird nur für die E-Mail-Info-, Calendar-Freigabe- und Frei/Gebucht-Funktionen unterstützt.
HTTP-Anforderung
POST /policies/crossTenantAccessPolicy/default/m365Capabilities
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung eines abgeleiteten Typs von m365CapabilityBase an. Die Eigenschaft @odata.type ist erforderlich, um den Funktionstyp anzugeben.
Sie können die folgenden Eigenschaften angeben, wenn Sie eine m365CapabilityBase-Funktion erstellen.
| Eigenschaft |
Typ |
Beschreibung |
| @odata.type |
Zeichenfolge |
Der Typ der zu erstellenden Funktion. Erforderlich. Beispielwerte: #microsoft.graph.crossTenantOpenProfileCard, #microsoft.graph.crossTenantMigration. |
| inboundAccess |
m365CapabilityInboundAccess |
Die Einstellungen für den eingehenden Zugriff für die Funktion. Erforderlich. |
Antwort
Bei erfolgreicher Ausführung gibt diese Methode einen 201 Created Antwortcode und das erstellte Funktionsobjekt im Antworttext zurück.
Beispiele
Beispiel 1: Erstellen einer mandantenübergreifenden offenen Profil-Karte
Im folgenden Beispiel wird gezeigt, wie Sie eine mandantenübergreifende Funktion zum Öffnen eines offenen Profils Karte erstellen.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/default/m365Capabilities
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantOpenProfileCard",
"inboundAccess": {
"isAllowed": true,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e00",
"resourceType": "group"
}
]
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new CrossTenantOpenProfileCard
{
OdataType = "#microsoft.graph.crossTenantOpenProfileCard",
InboundAccess = new M365CapabilityInboundAccess
{
IsAllowed = true,
ResourceScopes = new M365CapabilityResourceScopes
{
Included = new List<M365CapabilityResourceScope>
{
new M365CapabilityResourceScope
{
ResourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
ResourceType = M365ResourceType.Group,
},
},
Excluded = new List<M365CapabilityResourceScope>
{
new M365CapabilityResourceScope
{
ResourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e00",
ResourceType = M365ResourceType.Group,
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.CrossTenantAccessPolicy.Default.M365Capabilities.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.NewM365CapabilityBase()
inboundAccess := graphmodels.NewM365CapabilityInboundAccess()
isAllowed := true
inboundAccess.SetIsAllowed(&isAllowed)
resourceScopes := graphmodels.NewM365CapabilityResourceScopes()
m365CapabilityResourceScope := graphmodels.NewM365CapabilityResourceScope()
resourceId := "ad4fc698-74dc-4f62-9e71-ba9b591e8e74"
m365CapabilityResourceScope.SetResourceId(&resourceId)
resourceType := graphmodels.GROUP_M365RESOURCETYPE
m365CapabilityResourceScope.SetResourceType(&resourceType)
included := []graphmodels.M365CapabilityResourceScopeable {
m365CapabilityResourceScope,
}
resourceScopes.SetIncluded(included)
m365CapabilityResourceScope := graphmodels.NewM365CapabilityResourceScope()
resourceId := "ad4fc698-74dc-4f62-9e71-ba9b591e8e00"
m365CapabilityResourceScope.SetResourceId(&resourceId)
resourceType := graphmodels.GROUP_M365RESOURCETYPE
m365CapabilityResourceScope.SetResourceType(&resourceType)
excluded := []graphmodels.M365CapabilityResourceScopeable {
m365CapabilityResourceScope,
}
resourceScopes.SetExcluded(excluded)
inboundAccess.SetResourceScopes(resourceScopes)
requestBody.SetInboundAccess(inboundAccess)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
m365Capabilities, err := graphClient.Policies().CrossTenantAccessPolicy().Default().M365Capabilities().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CrossTenantOpenProfileCard m365CapabilityBase = new CrossTenantOpenProfileCard();
m365CapabilityBase.setOdataType("#microsoft.graph.crossTenantOpenProfileCard");
M365CapabilityInboundAccess inboundAccess = new M365CapabilityInboundAccess();
inboundAccess.setIsAllowed(true);
M365CapabilityResourceScopes resourceScopes = new M365CapabilityResourceScopes();
LinkedList<M365CapabilityResourceScope> included = new LinkedList<M365CapabilityResourceScope>();
M365CapabilityResourceScope m365CapabilityResourceScope = new M365CapabilityResourceScope();
m365CapabilityResourceScope.setResourceId("ad4fc698-74dc-4f62-9e71-ba9b591e8e74");
m365CapabilityResourceScope.setResourceType(M365ResourceType.Group);
included.add(m365CapabilityResourceScope);
resourceScopes.setIncluded(included);
LinkedList<M365CapabilityResourceScope> excluded = new LinkedList<M365CapabilityResourceScope>();
M365CapabilityResourceScope m365CapabilityResourceScope1 = new M365CapabilityResourceScope();
m365CapabilityResourceScope1.setResourceId("ad4fc698-74dc-4f62-9e71-ba9b591e8e00");
m365CapabilityResourceScope1.setResourceType(M365ResourceType.Group);
excluded.add(m365CapabilityResourceScope1);
resourceScopes.setExcluded(excluded);
inboundAccess.setResourceScopes(resourceScopes);
m365CapabilityBase.setInboundAccess(inboundAccess);
M365CapabilityBase result = graphClient.policies().crossTenantAccessPolicy().defaultEscaped().m365Capabilities().post(m365CapabilityBase);
const options = {
authProvider,
};
const client = Client.init(options);
const m365CapabilityBase = {
'@odata.type': '#microsoft.graph.crossTenantOpenProfileCard',
inboundAccess: {
isAllowed: true,
resourceScopes: {
included: [
{
resourceId: 'ad4fc698-74dc-4f62-9e71-ba9b591e8e74',
resourceType: 'group'
}
],
excluded: [
{
resourceId: 'ad4fc698-74dc-4f62-9e71-ba9b591e8e00',
resourceType: 'group'
}
]
}
}
};
await client.api('/policies/crossTenantAccessPolicy/default/m365Capabilities')
.version('beta')
.post(m365CapabilityBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CrossTenantOpenProfileCard;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityInboundAccess;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScopes;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScope;
use Microsoft\Graph\Beta\Generated\Models\M365ResourceType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CrossTenantOpenProfileCard();
$requestBody->setOdataType('#microsoft.graph.crossTenantOpenProfileCard');
$inboundAccess = new M365CapabilityInboundAccess();
$inboundAccess->setIsAllowed(true);
$inboundAccessResourceScopes = new M365CapabilityResourceScopes();
$includedM365CapabilityResourceScope1 = new M365CapabilityResourceScope();
$includedM365CapabilityResourceScope1->setResourceId('ad4fc698-74dc-4f62-9e71-ba9b591e8e74');
$includedM365CapabilityResourceScope1->setResourceType(new M365ResourceType('group'));
$includedArray []= $includedM365CapabilityResourceScope1;
$inboundAccessResourceScopes->setIncluded($includedArray);
$excludedM365CapabilityResourceScope1 = new M365CapabilityResourceScope();
$excludedM365CapabilityResourceScope1->setResourceId('ad4fc698-74dc-4f62-9e71-ba9b591e8e00');
$excludedM365CapabilityResourceScope1->setResourceType(new M365ResourceType('group'));
$excludedArray []= $excludedM365CapabilityResourceScope1;
$inboundAccessResourceScopes->setExcluded($excludedArray);
$inboundAccess->setResourceScopes($inboundAccessResourceScopes);
$requestBody->setInboundAccess($inboundAccess);
$result = $graphServiceClient->policies()->crossTenantAccessPolicy()->escapedDefault()->m365Capabilities()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.crossTenantOpenProfileCard"
inboundAccess = @{
isAllowed = $true
resourceScopes = @{
included = @(
@{
resourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74"
resourceType = "group"
}
)
excluded = @(
@{
resourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e00"
resourceType = "group"
}
)
}
}
}
New-MgBetaPolicyCrossTenantAccessPolicyDefaultM365Capability -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.cross_tenant_open_profile_card import CrossTenantOpenProfileCard
from msgraph_beta.generated.models.m365_capability_inbound_access import M365CapabilityInboundAccess
from msgraph_beta.generated.models.m365_capability_resource_scopes import M365CapabilityResourceScopes
from msgraph_beta.generated.models.m365_capability_resource_scope import M365CapabilityResourceScope
from msgraph_beta.generated.models.m365_resource_type import M365ResourceType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CrossTenantOpenProfileCard(
odata_type = "#microsoft.graph.crossTenantOpenProfileCard",
inbound_access = M365CapabilityInboundAccess(
is_allowed = True,
resource_scopes = M365CapabilityResourceScopes(
included = [
M365CapabilityResourceScope(
resource_id = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
resource_type = M365ResourceType.Group,
),
],
excluded = [
M365CapabilityResourceScope(
resource_id = "ad4fc698-74dc-4f62-9e71-ba9b591e8e00",
resource_type = M365ResourceType.Group,
),
],
),
),
)
result = await graph_client.policies.cross_tenant_access_policy.default.m365_capabilities.post(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantOpenProfileCard",
"name": "crossTenantOpenProfileCard",
"lastModifiedDateTime": "2026-01-15T10:04:11.4531504Z",
"inboundAccess": {
"isAllowed": true,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e00",
"resourceType": "group"
}
]
}
}
}
Beispiel 2: Erstellen einer mandantenübergreifenden Migrationsfunktion
Das folgende Beispiel zeigt, wie Sie eine mandantenübergreifende Migrationsfunktion erstellen.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/default/m365Capabilities
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantMigration",
"inboundAccess": {
"isAllowed": true,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": []
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new CrossTenantMigration
{
OdataType = "#microsoft.graph.crossTenantMigration",
InboundAccess = new M365CapabilityInboundAccess
{
IsAllowed = true,
ResourceScopes = new M365CapabilityResourceScopes
{
Included = new List<M365CapabilityResourceScope>
{
new M365CapabilityResourceScope
{
ResourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
ResourceType = M365ResourceType.Group,
},
},
Excluded = new List<M365CapabilityResourceScope>
{
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.CrossTenantAccessPolicy.Default.M365Capabilities.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.NewM365CapabilityBase()
inboundAccess := graphmodels.NewM365CapabilityInboundAccess()
isAllowed := true
inboundAccess.SetIsAllowed(&isAllowed)
resourceScopes := graphmodels.NewM365CapabilityResourceScopes()
m365CapabilityResourceScope := graphmodels.NewM365CapabilityResourceScope()
resourceId := "ad4fc698-74dc-4f62-9e71-ba9b591e8e74"
m365CapabilityResourceScope.SetResourceId(&resourceId)
resourceType := graphmodels.GROUP_M365RESOURCETYPE
m365CapabilityResourceScope.SetResourceType(&resourceType)
included := []graphmodels.M365CapabilityResourceScopeable {
m365CapabilityResourceScope,
}
resourceScopes.SetIncluded(included)
excluded := []graphmodels.M365CapabilityResourceScopeable {
}
resourceScopes.SetExcluded(excluded)
inboundAccess.SetResourceScopes(resourceScopes)
requestBody.SetInboundAccess(inboundAccess)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
m365Capabilities, err := graphClient.Policies().CrossTenantAccessPolicy().Default().M365Capabilities().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CrossTenantMigration m365CapabilityBase = new CrossTenantMigration();
m365CapabilityBase.setOdataType("#microsoft.graph.crossTenantMigration");
M365CapabilityInboundAccess inboundAccess = new M365CapabilityInboundAccess();
inboundAccess.setIsAllowed(true);
M365CapabilityResourceScopes resourceScopes = new M365CapabilityResourceScopes();
LinkedList<M365CapabilityResourceScope> included = new LinkedList<M365CapabilityResourceScope>();
M365CapabilityResourceScope m365CapabilityResourceScope = new M365CapabilityResourceScope();
m365CapabilityResourceScope.setResourceId("ad4fc698-74dc-4f62-9e71-ba9b591e8e74");
m365CapabilityResourceScope.setResourceType(M365ResourceType.Group);
included.add(m365CapabilityResourceScope);
resourceScopes.setIncluded(included);
LinkedList<M365CapabilityResourceScope> excluded = new LinkedList<M365CapabilityResourceScope>();
resourceScopes.setExcluded(excluded);
inboundAccess.setResourceScopes(resourceScopes);
m365CapabilityBase.setInboundAccess(inboundAccess);
M365CapabilityBase result = graphClient.policies().crossTenantAccessPolicy().defaultEscaped().m365Capabilities().post(m365CapabilityBase);
const options = {
authProvider,
};
const client = Client.init(options);
const m365CapabilityBase = {
'@odata.type': '#microsoft.graph.crossTenantMigration',
inboundAccess: {
isAllowed: true,
resourceScopes: {
included: [
{
resourceId: 'ad4fc698-74dc-4f62-9e71-ba9b591e8e74',
resourceType: 'group'
}
],
excluded: []
}
}
};
await client.api('/policies/crossTenantAccessPolicy/default/m365Capabilities')
.version('beta')
.post(m365CapabilityBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CrossTenantMigration;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityInboundAccess;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScopes;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScope;
use Microsoft\Graph\Beta\Generated\Models\M365ResourceType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CrossTenantMigration();
$requestBody->setOdataType('#microsoft.graph.crossTenantMigration');
$inboundAccess = new M365CapabilityInboundAccess();
$inboundAccess->setIsAllowed(true);
$inboundAccessResourceScopes = new M365CapabilityResourceScopes();
$includedM365CapabilityResourceScope1 = new M365CapabilityResourceScope();
$includedM365CapabilityResourceScope1->setResourceId('ad4fc698-74dc-4f62-9e71-ba9b591e8e74');
$includedM365CapabilityResourceScope1->setResourceType(new M365ResourceType('group'));
$includedArray []= $includedM365CapabilityResourceScope1;
$inboundAccessResourceScopes->setIncluded($includedArray);
$inboundAccessResourceScopes->setExcluded([]);
$inboundAccess->setResourceScopes($inboundAccessResourceScopes);
$requestBody->setInboundAccess($inboundAccess);
$result = $graphServiceClient->policies()->crossTenantAccessPolicy()->escapedDefault()->m365Capabilities()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.crossTenantMigration"
inboundAccess = @{
isAllowed = $true
resourceScopes = @{
included = @(
@{
resourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74"
resourceType = "group"
}
)
excluded = @(
)
}
}
}
New-MgBetaPolicyCrossTenantAccessPolicyDefaultM365Capability -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.cross_tenant_migration import CrossTenantMigration
from msgraph_beta.generated.models.m365_capability_inbound_access import M365CapabilityInboundAccess
from msgraph_beta.generated.models.m365_capability_resource_scopes import M365CapabilityResourceScopes
from msgraph_beta.generated.models.m365_capability_resource_scope import M365CapabilityResourceScope
from msgraph_beta.generated.models.m365_resource_type import M365ResourceType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CrossTenantMigration(
odata_type = "#microsoft.graph.crossTenantMigration",
inbound_access = M365CapabilityInboundAccess(
is_allowed = True,
resource_scopes = M365CapabilityResourceScopes(
included = [
M365CapabilityResourceScope(
resource_id = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
resource_type = M365ResourceType.Group,
),
],
excluded = [
],
),
),
)
result = await graph_client.policies.cross_tenant_access_policy.default.m365_capabilities.post(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantMigration",
"name": "crossTenantMigration",
"lastModifiedDateTime": "2026-01-15T10:08:08.8321956Z",
"inboundAccess": {
"isAllowed": true,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": []
}
}
}
Verwandte Inhalte