名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
RBAC プロバイダーの unifiedRoleDefinition オブジェクトを削除します。 組み込みの役割は削除できません。 この機能には、Microsoft Entra ID P1 または P2 ライセンスが必要です。
現在、次の RBAC プロバイダーがサポートされています。
- クラウド PC
- デバイス管理 (Intune)
- Defender (Microsoft Defender XDR統合 RBAC)
- directory (Microsoft Entra ID)
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
✅ |
アクセス許可
次の表は、サポートされている各リソースの種類でこの API を呼び出すために必要な最小特権のアクセス許可またはアクセス許可を示しています。
ベスト プラクティスに従って、最小限の特権のアクセス許可を要求します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
クラウド PC プロバイダーの場合
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
DeviceManagementRBAC.ReadWrite.All |
CloudPC.ReadWrite.All、Directory.ReadWrite.All、RoleManagement.ReadWrite.CloudPC、RoleManagement.ReadWrite.Directory |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
DeviceManagementRBAC.ReadWrite.All |
CloudPC.ReadWrite.All、Directory.ReadWrite.All、RoleManagement.ReadWrite.CloudPC、RoleManagement.ReadWrite.Directory |
デバイス管理 (Intune) プロバイダーの場合
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
RoleManagement.ReadWrite.Directory |
Directory.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
RoleManagement.ReadWrite.Directory |
Directory.ReadWrite.All |
Defender プロバイダーの場合
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
DeviceManagementRBAC.ReadWrite.All |
CloudPC.ReadWrite.All、Directory.ReadWrite.All、RoleManagement.ReadWrite.CloudPC、RoleManagement.ReadWrite.Directory |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
DeviceManagementRBAC.ReadWrite.All |
CloudPC.ReadWrite.All、Directory.ReadWrite.All、RoleManagement.ReadWrite.CloudPC、RoleManagement.ReadWrite.Directory |
ディレクトリ (Microsoft Entra ID) プロバイダーの場合
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
RoleManagement.ReadWrite.Defender |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
RoleManagement.ReadWrite.Defender |
注意事項なし。 |
重要
職場または学校アカウントを使用した委任されたシナリオでは、サインインしているユーザーに、サポートされているMicrosoft Entraロールまたはサポートされているロールのアクセス許可を持つカスタム ロールを割り当てる必要があります。
特権ロール管理者 は、この操作でサポートされる最小限の特権ロールです。
HTTP 要求
デバイス管理プロバイダーのロール定義を削除するには:
DELETE /roleManagement/deviceManagement/roleDefinitions/{id}
ディレクトリ プロバイダーのロール定義を削除するには:
DELETE /roleManagement/directory/roleDefinitions/{id}
クラウド PC プロバイダーのロール定義を削除するには:
DELETE /roleManagement/cloudPc/roleDefinitions/{id}
Defender プロバイダーのロール定義を削除するには:
DELETE /roleManagement/defender/roleDefinitions/{id}
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 204 No Content 応答コードを返します。 応答本文では何も返されません。
例 1: ディレクトリ プロバイダーの unifiedRoleDefinition リソースを削除する
要求
DELETE https://graph.microsoft.com/beta/roleManagement/directory/roleDefinitions/f189965f-f560-4c59-9101-933d4c87a91a
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.RoleManagement.Directory.RoleDefinitions["{unifiedRoleDefinition-id}"].DeleteAsync();
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.RoleManagement().Directory().RoleDefinitions().ByUnifiedRoleDefinitionId("unifiedRoleDefinition-id").Delete(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.roleManagement().directory().roleDefinitions().byUnifiedRoleDefinitionId("{unifiedRoleDefinition-id}").delete();
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/roleManagement/directory/roleDefinitions/f189965f-f560-4c59-9101-933d4c87a91a')
.version('beta')
.delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->roleManagement()->directory()->roleDefinitions()->byUnifiedRoleDefinitionId('unifiedRoleDefinition-id')->delete()->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
Remove-MgBetaRoleManagementDirectoryRoleDefinition -UnifiedRoleDefinitionId $unifiedRoleDefinitionId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
await graph_client.role_management.directory.role_definitions.by_unified_role_definition_id('unifiedRoleDefinition-id').delete()
応答
次の例は応答を示しています。
HTTP/1.1 204 No Content
例 2: クラウド PC プロバイダーの unifiedRoleDefinition リソースを削除する
要求
DELETE https://graph.microsoft.com/beta/roleManagement/cloudPC/roleDefinitions/b7f5ddc1-b7dc-4d37-abce-b9d6fc15ffff
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.RoleManagement.CloudPC.RoleDefinitions["{unifiedRoleDefinition-id}"].DeleteAsync();
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.RoleManagement().CloudPC().RoleDefinitions().ByUnifiedRoleDefinitionId("unifiedRoleDefinition-id").Delete(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.roleManagement().cloudPC().roleDefinitions().byUnifiedRoleDefinitionId("{unifiedRoleDefinition-id}").delete();
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/roleManagement/cloudPC/roleDefinitions/b7f5ddc1-b7dc-4d37-abce-b9d6fc15ffff')
.version('beta')
.delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->roleManagement()->cloudPC()->roleDefinitions()->byUnifiedRoleDefinitionId('unifiedRoleDefinition-id')->delete()->wait();
Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
Remove-MgBetaRoleManagementCloudPcRoleDefinition -UnifiedRoleDefinitionId $unifiedRoleDefinitionId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
await graph_client.role_management.cloud_p_c.role_definitions.by_unified_role_definition_id('unifiedRoleDefinition-id').delete()
応答
次の例は応答を示しています。
HTTP/1.1 204 No Content
例 3: Defender プロバイダーの unifiedRoleDefinition リソースを削除する
要求
DELETE https://graph.microsoft.com/beta/roleManagement/defender/roleDefinitions/f189965f-f560-4c59-9101-933d4c87a91a
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.RoleManagement.Defender.RoleDefinitions["{unifiedRoleDefinition-id}"].DeleteAsync();
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.RoleManagement().Defender().RoleDefinitions().ByUnifiedRoleDefinitionId("unifiedRoleDefinition-id").Delete(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.roleManagement().defender().roleDefinitions().byUnifiedRoleDefinitionId("{unifiedRoleDefinition-id}").delete();
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/roleManagement/defender/roleDefinitions/f189965f-f560-4c59-9101-933d4c87a91a')
.version('beta')
.delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->roleManagement()->defender()->roleDefinitions()->byUnifiedRoleDefinitionId('unifiedRoleDefinition-id')->delete()->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
await graph_client.role_management.defender.role_definitions.by_unified_role_definition_id('unifiedRoleDefinition-id').delete()
応答
次の例は応答を示しています。
HTTP/1.1 204 No Content