名前空間: microsoft.graph
新しい connectedOrganization オブジェクトを作成します。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
委任 (職場または学校のアカウント) |
EntitlementManagement.ReadWrite.All |
注意事項なし。 |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
EntitlementManagement.ReadWrite.All |
注意事項なし。 |
ヒント
職場または学校アカウントを使用した委任されたシナリオでは、サインインしているユーザーに、次のオプションを使用して、サポートされているロールのアクセス許可を持つ管理者ロールも割り当てる必要があります。
-
最小特権ロールが ID ガバナンス管理者であるMicrosoft Entraロール。
これは最小限の特権オプションです。
アプリのみのシナリオでは、呼び出し元のアプリに、 EntitlementManagement.ReadWrite.All
アプリケーションのアクセス許可ではなく、前述のサポートされているロールのいずれかを割り当てることができます。
IDENTITY Governance Administrator ロールの特権は、EntitlementManagement.ReadWrite.All
アプリケーションのアクセス許可よりも低くなります。
詳細については、「エンタイトルメント管理での委任とロール」および「エンタイトルメント管理でパッケージ マネージャーにアクセスするためのアクセス ガバナンスを委任する方法」を参照してください。
HTTP 要求
POST /identityGovernance/entitlementManagement/connectedOrganizations
名前 |
説明 |
Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、 connectedOrganization オブジェクトの JSON 表現を指定します。
connectedOrganization を作成するときに、次のプロパティを指定できます。
プロパティ |
型 |
説明 |
displayName |
String |
接続されたorganization名。 |
説明 |
String |
接続されたorganizationの説明。 |
identitySources |
identitySource コレクション |
1 つの要素を持つコレクション。この接続されたorganization内の初期 ID ソース。 |
state |
connectedOrganizationState |
接続されたorganizationの状態は、要求者スコープの種類がAllConfiguredConnectedOrganizationSubjects 割り当てポリシーを適用できるかどうかを定義します。 可能な値は、configured 、proposed です。 |
応答
成功した場合、このメソッドは応答コード 201 Created
と、応答本文に新しい connectedOrganization オブジェクトを返します。
例
例 1: 接続されたorganizationを作成する
要求
POST https://graph.microsoft.com/v1.0/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.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);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc identity-governance entitlement-management connected-organizations create --body '{\
"displayName":"Connected organization name",\
"description":"Connected organization description",\
"identitySources": [\
{\
"@odata.type": "#microsoft.graph.domainIdentitySource",\
"domainName": "example.com",\
"displayName": "example.com"\
}\
],\
"state":"proposed"\
}\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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"
graphmodels "github.com/microsoftgraph/msgraph-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)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
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/')
.post(connectedOrganization);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ConnectedOrganization;
use Microsoft\Graph\Generated\Models\IdentitySource;
use Microsoft\Graph\Generated\Models\DomainIdentitySource;
use Microsoft\Graph\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();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.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-MgEntitlementManagementConnectedOrganization -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# 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)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-type: application/json
{
"id": "35ff48a8-e9d8-4405-8425-0b23694287a4",
"displayName": "Connected organization name",
"description": "Connected organization description",
"createdDateTime": "2021-11-10T01:13:15.541617Z",
"modifiedDateTime": "2021-11-10T01:13:15.541617Z",
"state": "proposed",
"identitySources": []
}
例 2: テナント ID に基づいて identitySource を使用して接続されたorganizationを作成する
この例では、テナント ID に基づいて ID ソースを使用して接続されたorganizationを作成する方法を示します。 テナント ID は、 tenantRelationship: findTenantInformationByDomainName 呼び出しを使用して、ドメイン名によって見つけることができます。
要求
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);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc-beta identity-governance entitlement-management connected-organizations create --body '{\
"displayName":"Connected organization name",\
"description":"Connected organization description",\
"identitySources": [\
{\
"@odata.type": "#microsoft.graph.azureActiveDirectoryTenant",\
"displayName": "Contoso",\
"tenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee"\
}\
],\
"state":"proposed"\
}\
\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
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);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?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();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
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
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# 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)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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": []
}