Indicates execution status of the malware. Possible values are: unknown, blocked, allowed, running, notRunning. Defaults to unknown. Possible values are: unknown, blocked, allowed, running, notRunning.
// 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);
// 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);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MalwareStateForWindowsDevice;
use Microsoft\Graph\Generated\Models\WindowsMalwareExecutionState;
use Microsoft\Graph\Generated\Models\WindowsMalwareThreatState;
$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();
Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.