POST https://graph.microsoft.com/v1.0/domains/{id}/forceDelete
Content-type: application/json
{
"disableUserAccounts": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Domains.Item.ForceDelete;
var requestBody = new ForceDeletePostRequestBody
{
DisableUserAccounts = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Domains["{domain-id}"].ForceDelete.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"
graphdomains "github.com/microsoftgraph/msgraph-sdk-go/domains"
//other-imports
)
requestBody := graphdomains.NewForceDeletePostRequestBody()
disableUserAccounts := true
requestBody.SetDisableUserAccounts(&disableUserAccounts)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Domains().ByDomainId("domain-id").ForceDelete().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.domains.item.forcedelete.ForceDeletePostRequestBody forceDeletePostRequestBody = new com.microsoft.graph.domains.item.forcedelete.ForceDeletePostRequestBody();
forceDeletePostRequestBody.setDisableUserAccounts(true);
graphClient.domains().byDomainId("{domain-id}").forceDelete().post(forceDeletePostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Domains\Item\ForceDelete\ForceDeletePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ForceDeletePostRequestBody();
$requestBody->setDisableUserAccounts(true);
$graphServiceClient->domains()->byDomainId('domain-id')->forceDelete()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.domains.item.force_delete.force_delete_post_request_body import ForceDeletePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ForceDeletePostRequestBody(
disable_user_accounts = True,
)
await graph_client.domains.by_domain_id('domain-id').force_delete.post(request_body)