名前空間: microsoft.graph
注:Intune 用 Microsoft Graph API には、テナントの有効な Intune ライセンスが必要です。
onPremisesConditionalAccessSettings オブジェクトのプロパティを更新します。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
✅ |
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
委任 (職場または学校のアカウント) |
DeviceManagementServiceConfig.ReadWrite.All、DeviceManagementConfiguration.ReadWrite.All |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
アプリケーション |
DeviceManagementServiceConfig.ReadWrite.All、DeviceManagementConfiguration.ReadWrite.All |
HTTP 要求
PATCH /deviceManagement/conditionalAccessSettings
ヘッダー |
値 |
Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
承諾 |
application/json |
要求本文
要求本文で、onPremisesConditionalAccessSettings オブジェクトの JSON 表記を指定します。
次の表に、onPremisesConditionalAccessSettings の作成時に必要なプロパティを示します。
プロパティ |
型 |
説明 |
id |
String |
まだ文書化されていません |
enabled |
ブール型 (Boolean) |
対象組織で、オンプレミスの条件付きアクセスが有効かどうかを示します。 |
includedGroups |
Guid コレクション |
オンプレミスの条件付きアクセスで対象となるユーザー グループ。 これらのグループ内のユーザーすべては、管理対象のモバイル デバイスを持っており、メール アクセスに準拠している必要があります。 |
excludedGroups |
Guid コレクション |
オンプレミスの条件付きアクセスで除外されるユーザー グループ。 これらのグループ内のすべてのユーザーは、条件付きアクセス ポリシーから除外されます。 |
overrideDefaultRule |
ブール型 (Boolean) |
デバイスでアクセスが付与されていることを確認できるようにするとき、既定のアクセス ルールを上書きします。 |
応答
成功した場合、このメソッドは 200 OK
応答コードと、更新された onPremisesConditionalAccessSettings オブジェクトを応答本文で返します。
例
要求
以下は、要求の例です。
PATCH https://graph.microsoft.com/v1.0/deviceManagement/conditionalAccessSettings
Content-type: application/json
Content-length: 275
{
"@odata.type": "#microsoft.graph.onPremisesConditionalAccessSettings",
"enabled": true,
"includedGroups": [
"77c9d466-d466-77c9-66d4-c97766d4c977"
],
"excludedGroups": [
"2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"
],
"overrideDefaultRule": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnPremisesConditionalAccessSettings
{
OdataType = "#microsoft.graph.onPremisesConditionalAccessSettings",
Enabled = true,
IncludedGroups = new List<Guid?>
{
Guid.Parse("77c9d466-d466-77c9-66d4-c97766d4c977"),
},
ExcludedGroups = new List<Guid?>
{
Guid.Parse("2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"),
},
OverrideDefaultRule = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.ConditionalAccessSettings.PatchAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc device-management conditional-access-settings patch --body '{\
"@odata.type": "#microsoft.graph.onPremisesConditionalAccessSettings",\
"enabled": true,\
"includedGroups": [\
"77c9d466-d466-77c9-66d4-c97766d4c977"\
],\
"excludedGroups": [\
"2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"\
],\
"overrideDefaultRule": true\
}\
'
プロジェクトに 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.NewOnPremisesConditionalAccessSettings()
enabled := true
requestBody.SetEnabled(&enabled)
includedGroups := []uuid.UUID {
uuid.MustParse("77c9d466-d466-77c9-66d4-c97766d4c977"),
}
requestBody.SetIncludedGroups(includedGroups)
excludedGroups := []uuid.UUID {
uuid.MustParse("2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"),
}
requestBody.SetExcludedGroups(excludedGroups)
overrideDefaultRule := true
requestBody.SetOverrideDefaultRule(&overrideDefaultRule)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
conditionalAccessSettings, err := graphClient.DeviceManagement().ConditionalAccessSettings().Patch(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);
OnPremisesConditionalAccessSettings onPremisesConditionalAccessSettings = new OnPremisesConditionalAccessSettings();
onPremisesConditionalAccessSettings.setOdataType("#microsoft.graph.onPremisesConditionalAccessSettings");
onPremisesConditionalAccessSettings.setEnabled(true);
LinkedList<UUID> includedGroups = new LinkedList<UUID>();
includedGroups.add(UUID.fromString("77c9d466-d466-77c9-66d4-c97766d4c977"));
onPremisesConditionalAccessSettings.setIncludedGroups(includedGroups);
LinkedList<UUID> excludedGroups = new LinkedList<UUID>();
excludedGroups.add(UUID.fromString("2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"));
onPremisesConditionalAccessSettings.setExcludedGroups(excludedGroups);
onPremisesConditionalAccessSettings.setOverrideDefaultRule(true);
OnPremisesConditionalAccessSettings result = graphClient.deviceManagement().conditionalAccessSettings().patch(onPremisesConditionalAccessSettings);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const onPremisesConditionalAccessSettings = {
'@odata.type': '#microsoft.graph.onPremisesConditionalAccessSettings',
enabled: true,
includedGroups: [
'77c9d466-d466-77c9-66d4-c97766d4c977'
],
excludedGroups: [
'2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a'
],
overrideDefaultRule: true
};
await client.api('/deviceManagement/conditionalAccessSettings')
.update(onPremisesConditionalAccessSettings);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\OnPremisesConditionalAccessSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OnPremisesConditionalAccessSettings();
$requestBody->setOdataType('#microsoft.graph.onPremisesConditionalAccessSettings');
$requestBody->setEnabled(true);
$requestBody->setIncludedGroups(['77c9d466-d466-77c9-66d4-c97766d4c977', ]);
$requestBody->setExcludedGroups(['2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a', ]);
$requestBody->setOverrideDefaultRule(true);
$result = $graphServiceClient->deviceManagement()->conditionalAccessSettings()->patch($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.DeviceManagement.Enrollment
$params = @{
"@odata.type" = "#microsoft.graph.onPremisesConditionalAccessSettings"
enabled = $true
includedGroups = @(
"77c9d466-d466-77c9-66d4-c97766d4c977"
)
excludedGroups = @(
"2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"
)
overrideDefaultRule = $true
}
Update-MgDeviceManagementConditionalAccessSetting -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.on_premises_conditional_access_settings import OnPremisesConditionalAccessSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnPremisesConditionalAccessSettings(
odata_type = "#microsoft.graph.onPremisesConditionalAccessSettings",
enabled = True,
included_groups = [
UUID("77c9d466-d466-77c9-66d4-c97766d4c977"),
],
excluded_groups = [
UUID("2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"),
],
override_default_rule = True,
)
result = await graph_client.device_management.conditional_access_settings.patch(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 324
{
"@odata.type": "#microsoft.graph.onPremisesConditionalAccessSettings",
"id": "a0efde21-de21-a0ef-21de-efa021deefa0",
"enabled": true,
"includedGroups": [
"77c9d466-d466-77c9-66d4-c97766d4c977"
],
"excludedGroups": [
"2a0afae4-fae4-2a0a-e4fa-0a2ae4fa0a2a"
],
"overrideDefaultRule": true
}