malwareStateForWindowsDevice を作成する
[アーティクル]
02/01/2024
6 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
注: Intune 用 Microsoft Graph API には、テナントの有効な Intune ライセンス が必要です。
新しい malwareStateForWindowsDevice オブジェクトを 作成します。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
✅
✅
✅
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
DeviceManagementManagedDevices.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
DeviceManagementManagedDevices.ReadWrite.All
HTTP 要求
POST /deviceManagement/windowsMalwareInformation/{windowsMalwareInformationId}/deviceMalwareStates
ヘッダー
値
Authorization
ベアラー {token}。 必須です。 認証と承認 の詳細については、こちらをご覧ください。
承諾
application/json
要求本文
要求本文で、malwareStateForWindowsDevice オブジェクトの JSON 表現を指定します。
次の表は、malwareStateForWindowsDevice を作成するときに必要なプロパティを示しています。
プロパティ
型
説明
id
String
一意の識別子。 これはデバイス ID です。
deviceName
String
マルウェアの状態を評価するデバイスの名前を示します
executionState
windowsMalwareExecutionState
マルウェアの実行状態を示します。 使用可能な値は、不明、ブロック、許可、実行、notRunning です。 既定値は unknown です。 可能な値は、unknown
、blocked
、allowed
、running
、notRunning
です。
threatState
windowsMalwareThreatState
マルウェアの脅威の状態を示します。 使用可能な値は、アクティブ、actionFailed、manualStepsRequired、fullScanRequired、rebootRequired、remediatedWithNonCriticalFailures、検疫、削除、クリーンアップ、許可、noStatusCleared です。 既定値は noStatusCleared です。 使用可能な値は、active
、actionFailed
、manualStepsRequired
、fullScanRequired
、rebootRequired
、remediatedWithNonCriticalFailures
、quarantined
、removed
、cleaned
、allowed
、noStatusCleared
です。
initialDetectionDateTime
DateTimeOffset
マルウェアの初期検出日時
lastStateChangeDateTime
DateTimeOffset
この特定の脅威が最後に変更された時刻
detectionCount
Int32
マルウェアが検出された回数を示します
応答
成功した場合、このメソッドは 201 Created
応答コードと、応答本文に malwareStateForWindowsDevice オブジェクトを返します。
例
要求
以下は、要求の例です。
POST https://graph.microsoft.com/v1.0/deviceManagement/windowsMalwareInformation/{windowsMalwareInformationId}/deviceMalwareStates
Content-type: application/json
Content-length: 334
{
"@odata.type": "#microsoft.graph.malwareStateForWindowsDevice",
"deviceName": "Device Name value",
"executionState": "blocked",
"threatState": "actionFailed",
"initialDetectionDateTime": "2016-12-31T23:57:05.3889692-08:00",
"lastStateChangeDateTime": "2016-12-31T23:59:51.0767794-08:00",
"detectionCount": 14
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new MalwareStateForWindowsDevice
{
OdataType = "#microsoft.graph.malwareStateForWindowsDevice",
DeviceName = "Device Name value",
ExecutionState = WindowsMalwareExecutionState.Blocked,
ThreatState = WindowsMalwareThreatState.ActionFailed,
InitialDetectionDateTime = DateTimeOffset.Parse("2016-12-31T23:57:05.3889692-08:00"),
LastStateChangeDateTime = DateTimeOffset.Parse("2016-12-31T23:59:51.0767794-08:00"),
DetectionCount = 14,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.WindowsMalwareInformation["{windowsMalwareInformation-id}"].DeviceMalwareStates.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-management windows-malware-information device-malware-states create --windows-malware-information-id {windowsMalwareInformation-id} --body '{\
"@odata.type": "#microsoft.graph.malwareStateForWindowsDevice",\
"deviceName": "Device Name value",\
"executionState": "blocked",\
"threatState": "actionFailed",\
"initialDetectionDateTime": "2016-12-31T23:57:05.3889692-08:00",\
"lastStateChangeDateTime": "2016-12-31T23:59:51.0767794-08:00",\
"detectionCount": 14\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewMalwareStateForWindowsDevice()
deviceName := "Device Name value"
requestBody.SetDeviceName(&deviceName)
executionState := graphmodels.BLOCKED_WINDOWSMALWAREEXECUTIONSTATE
requestBody.SetExecutionState(&executionState)
threatState := graphmodels.ACTIONFAILED_WINDOWSMALWARETHREATSTATE
requestBody.SetThreatState(&threatState)
initialDetectionDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:57:05.3889692-08:00")
requestBody.SetInitialDetectionDateTime(&initialDetectionDateTime)
lastStateChangeDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:59:51.0767794-08:00")
requestBody.SetLastStateChangeDateTime(&lastStateChangeDateTime)
detectionCount := int32(14)
requestBody.SetDetectionCount(&detectionCount)
deviceMalwareStates, err := graphClient.DeviceManagement().WindowsMalwareInformation().ByWindowsMalwareInformationId("windowsMalwareInformation-id").DeviceMalwareStates().Post(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);
MalwareStateForWindowsDevice malwareStateForWindowsDevice = new MalwareStateForWindowsDevice();
malwareStateForWindowsDevice.setOdataType("#microsoft.graph.malwareStateForWindowsDevice");
malwareStateForWindowsDevice.setDeviceName("Device Name value");
malwareStateForWindowsDevice.setExecutionState(WindowsMalwareExecutionState.Blocked);
malwareStateForWindowsDevice.setThreatState(WindowsMalwareThreatState.ActionFailed);
OffsetDateTime initialDetectionDateTime = OffsetDateTime.parse("2016-12-31T23:57:05.3889692-08:00");
malwareStateForWindowsDevice.setInitialDetectionDateTime(initialDetectionDateTime);
OffsetDateTime lastStateChangeDateTime = OffsetDateTime.parse("2016-12-31T23:59:51.0767794-08:00");
malwareStateForWindowsDevice.setLastStateChangeDateTime(lastStateChangeDateTime);
malwareStateForWindowsDevice.setDetectionCount(14);
MalwareStateForWindowsDevice result = graphClient.deviceManagement().windowsMalwareInformation().byWindowsMalwareInformationId("{windowsMalwareInformation-id}").deviceMalwareStates().post(malwareStateForWindowsDevice);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const malwareStateForWindowsDevice = {
'@odata.type': '#microsoft.graph.malwareStateForWindowsDevice',
deviceName: 'Device Name value',
executionState: 'blocked',
threatState: 'actionFailed',
initialDetectionDateTime: '2016-12-31T23:57:05.3889692-08:00',
lastStateChangeDateTime: '2016-12-31T23:59:51.0767794-08:00',
detectionCount: 14
};
await client.api('/deviceManagement/windowsMalwareInformation/{windowsMalwareInformationId}/deviceMalwareStates')
.post(malwareStateForWindowsDevice);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MalwareStateForWindowsDevice;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MalwareStateForWindowsDevice();
$requestBody->setOdataType('#microsoft.graph.malwareStateForWindowsDevice');
$requestBody->setDeviceName('Device Name value');
$requestBody->setExecutionState(new WindowsMalwareExecutionState('blocked'));
$requestBody->setThreatState(new WindowsMalwareThreatState('actionFailed'));
$requestBody->setInitialDetectionDateTime(new \DateTime('2016-12-31T23:57:05.3889692-08:00'));
$requestBody->setLastStateChangeDateTime(new \DateTime('2016-12-31T23:59:51.0767794-08:00'));
$requestBody->setDetectionCount(14);
$result = $graphServiceClient->deviceManagement()->windowsMalwareInformation()->byWindowsMalwareInformationId('windowsMalwareInformation-id')->deviceMalwareStates()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.malwareStateForWindowsDevice"
deviceName = "Device Name value"
executionState = "blocked"
threatState = "actionFailed"
initialDetectionDateTime = [System.DateTime]::Parse("2016-12-31T23:57:05.3889692-08:00")
lastStateChangeDateTime = [System.DateTime]::Parse("2016-12-31T23:59:51.0767794-08:00")
detectionCount = 14
}
New-MgDeviceManagementWindowsMalwareInformationDeviceMalwareState -WindowsMalwareInformationId $windowsMalwareInformationId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.malware_state_for_windows_device import MalwareStateForWindowsDevice
graph_client = GraphServiceClient(credentials, scopes)
request_body = MalwareStateForWindowsDevice(
odata_type = "#microsoft.graph.malwareStateForWindowsDevice",
device_name = "Device Name value",
execution_state = WindowsMalwareExecutionState.Blocked,
threat_state = WindowsMalwareThreatState.ActionFailed,
initial_detection_date_time = "2016-12-31T23:57:05.3889692-08:00",
last_state_change_date_time = "2016-12-31T23:59:51.0767794-08:00",
detection_count = 14,
)
result = await graph_client.device_management.windows_malware_information.by_windows_malware_information_id('windowsMalwareInformation-id').device_malware_states.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 383
{
"@odata.type": "#microsoft.graph.malwareStateForWindowsDevice",
"id": "ce06da73-da73-ce06-73da-06ce73da06ce",
"deviceName": "Device Name value",
"executionState": "blocked",
"threatState": "actionFailed",
"initialDetectionDateTime": "2016-12-31T23:57:05.3889692-08:00",
"lastStateChangeDateTime": "2016-12-31T23:59:51.0767794-08:00",
"detectionCount": 14
}