POST https://graph.microsoft.com/v1.0/tenantRelationships/multiTenantOrganization/tenants
Content-Type: application/json
{
"tenantId": "4a12efe6-aa14-4d03-8dff-88fc89e2e2ad",
"displayName": "Fabrikam"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new MultiTenantOrganizationMember
{
TenantId = "4a12efe6-aa14-4d03-8dff-88fc89e2e2ad",
DisplayName = "Fabrikam",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.TenantRelationships.MultiTenantOrganization.Tenants.PostAsync(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"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMultiTenantOrganizationMember()
tenantId := "4a12efe6-aa14-4d03-8dff-88fc89e2e2ad"
requestBody.SetTenantId(&tenantId)
displayName := "Fabrikam"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
tenants, err := graphClient.TenantRelationships().MultiTenantOrganization().Tenants().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MultiTenantOrganizationMember multiTenantOrganizationMember = new MultiTenantOrganizationMember();
multiTenantOrganizationMember.setTenantId("4a12efe6-aa14-4d03-8dff-88fc89e2e2ad");
multiTenantOrganizationMember.setDisplayName("Fabrikam");
MultiTenantOrganizationMember result = graphClient.tenantRelationships().multiTenantOrganization().tenants().post(multiTenantOrganizationMember);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MultiTenantOrganizationMember;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MultiTenantOrganizationMember();
$requestBody->setTenantId('4a12efe6-aa14-4d03-8dff-88fc89e2e2ad');
$requestBody->setDisplayName('Fabrikam');
$result = $graphServiceClient->tenantRelationships()->multiTenantOrganization()->tenants()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.multi_tenant_organization_member import MultiTenantOrganizationMember
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MultiTenantOrganizationMember(
tenant_id = "4a12efe6-aa14-4d03-8dff-88fc89e2e2ad",
display_name = "Fabrikam",
)
result = await graph_client.tenant_relationships.multi_tenant_organization.tenants.post(request_body)