windowsDefenderAdvancedThreatProtectionConfiguration の更新
[アーティクル]
01/31/2024
11 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
注: Intune 用 Microsoft Graph API には、テナントの有効な Intune ライセンス が必要です。
windowsDefenderAdvancedThreatProtectionConfiguration オブジェクトのプロパティを更新します。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
✅
✅
✅
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
DeviceManagementConfiguration.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
DeviceManagementConfiguration.ReadWrite.All
HTTP 要求
PATCH /deviceManagement/deviceConfigurations/{deviceConfigurationId}
ヘッダー
値
Authorization
ベアラー {token}。 必須です。 認証と承認 の詳細については、こちらをご覧ください。
承諾
application/json
要求本文
要求本文で、windowsDefenderAdvancedThreatProtectionConfiguration オブジェクトの JSON 表記を指定します。
次の表に、windowsDefenderAdvancedThreatProtectionConfiguration の作成時に必要なプロパティを示します。
プロパティ
型
説明
id
String
エンティティのキー。 deviceConfiguration から継承します
lastModifiedDateTime
DateTimeOffset
オブジェクトの最終更新の DateTime。 deviceConfiguration から継承します
createdDateTime
DateTimeOffset
オブジェクトが作成された DateTime。 deviceConfiguration から継承します
description
String
管理者が指定した、デバイス構成についての説明。 deviceConfiguration から継承します
displayName
String
管理者が指定した、デバイス構成の名前。 deviceConfiguration から継承します
version
Int32
デバイス構成のバージョン。 deviceConfiguration から継承します
allowSampleSharing
Boolean
Windows Defender AdvancedThreatProtection の "サンプルの共有を許可する" ルール
enableExpeditedTelemetryReporting
Boolean
Windows Defender Advanced Threat Protection テレメトリ レポートの頻度を高めます。
応答
成功した場合、このメソッドは 200 OK
応答コードと、応答本文で更新された windowsDefenderAdvancedThreatProtectionConfiguration オブジェクトを返します。
例
要求
以下は、要求の例です。
PATCH https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/{deviceConfigurationId}
Content-type: application/json
Content-length: 267
{
"@odata.type": "#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"allowSampleSharing": true,
"enableExpeditedTelemetryReporting": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new WindowsDefenderAdvancedThreatProtectionConfiguration
{
OdataType = "#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
AllowSampleSharing = true,
EnableExpeditedTelemetryReporting = 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.DeviceConfigurations["{deviceConfiguration-id}"].PatchAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-management device-configurations patch --device-configuration-id {deviceConfiguration-id} --body '{\
"@odata.type": "#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"allowSampleSharing": true,\
"enableExpeditedTelemetryReporting": true\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewDeviceConfiguration()
description := "Description value"
requestBody.SetDescription(&description)
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
version := int32(7)
requestBody.SetVersion(&version)
allowSampleSharing := true
requestBody.SetAllowSampleSharing(&allowSampleSharing)
enableExpeditedTelemetryReporting := true
requestBody.SetEnableExpeditedTelemetryReporting(&enableExpeditedTelemetryReporting)
deviceConfigurations, err := graphClient.DeviceManagement().DeviceConfigurations().ByDeviceConfigurationId("deviceConfiguration-id").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);
WindowsDefenderAdvancedThreatProtectionConfiguration deviceConfiguration = new WindowsDefenderAdvancedThreatProtectionConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
deviceConfiguration.setAllowSampleSharing(true);
deviceConfiguration.setEnableExpeditedTelemetryReporting(true);
DeviceConfiguration result = graphClient.deviceManagement().deviceConfigurations().byDeviceConfigurationId("{deviceConfiguration-id}").patch(deviceConfiguration);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const deviceConfiguration = {
'@odata.type': '#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration',
description: 'Description value',
displayName: 'Display Name value',
version: 7,
allowSampleSharing: true,
enableExpeditedTelemetryReporting: true
};
await client.api('/deviceManagement/deviceConfigurations/{deviceConfigurationId}')
.update(deviceConfiguration);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\WindowsDefenderAdvancedThreatProtectionConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new WindowsDefenderAdvancedThreatProtectionConfiguration();
$requestBody->setOdataType('#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$requestBody->setVersion(7);
$requestBody->setAllowSampleSharing(true);
$requestBody->setEnableExpeditedTelemetryReporting(true);
$result = $graphServiceClient->deviceManagement()->deviceConfigurations()->byDeviceConfigurationId('deviceConfiguration-id')->patch($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
allowSampleSharing = $true
enableExpeditedTelemetryReporting = $true
}
Update-MgDeviceManagementDeviceConfiguration -DeviceConfigurationId $deviceConfigurationId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.windows_defender_advanced_threat_protection_configuration import WindowsDefenderAdvancedThreatProtectionConfiguration
graph_client = GraphServiceClient(credentials, scopes)
request_body = WindowsDefenderAdvancedThreatProtectionConfiguration(
odata_type = "#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration",
description = "Description value",
display_name = "Display Name value",
version = 7,
allow_sample_sharing = True,
enable_expedited_telemetry_reporting = True,
)
result = await graph_client.device_management.device_configurations.by_device_configuration_id('deviceConfiguration-id').patch(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 439
{
"@odata.type": "#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration",
"id": "294373aa-73aa-2943-aa73-4329aa734329",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"allowSampleSharing": true,
"enableExpeditedTelemetryReporting": true
}