PATCH https://graph.microsoft.com/v1.0/deviceManagement/mobileThreatDefenseConnectors/{mobileThreatDefenseConnectorId}
Content-type: application/json
Content-length: 772
{
"@odata.type": "#microsoft.graph.mobileThreatDefenseConnector",
"lastHeartbeatDateTime": "2016-12-31T23:59:37.9174975-08:00",
"partnerState": "available",
"androidMobileApplicationManagementEnabled": true,
"iosMobileApplicationManagementEnabled": true,
"androidEnabled": true,
"iosEnabled": true,
"windowsEnabled": true,
"androidDeviceBlockedOnMissingPartnerData": true,
"iosDeviceBlockedOnMissingPartnerData": true,
"windowsDeviceBlockedOnMissingPartnerData": true,
"partnerUnsupportedOsVersionBlocked": true,
"partnerUnresponsivenessThresholdInDays": 6,
"allowPartnerToCollectIOSApplicationMetadata": true,
"allowPartnerToCollectIOSPersonalApplicationMetadata": true,
"microsoftDefenderForEndpointAttachEnabled": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new MobileThreatDefenseConnector
{
OdataType = "#microsoft.graph.mobileThreatDefenseConnector",
LastHeartbeatDateTime = DateTimeOffset.Parse("2016-12-31T23:59:37.9174975-08:00"),
PartnerState = MobileThreatPartnerTenantState.Available,
AndroidMobileApplicationManagementEnabled = true,
IosMobileApplicationManagementEnabled = true,
AndroidEnabled = true,
IosEnabled = true,
WindowsEnabled = true,
AndroidDeviceBlockedOnMissingPartnerData = true,
IosDeviceBlockedOnMissingPartnerData = true,
WindowsDeviceBlockedOnMissingPartnerData = true,
PartnerUnsupportedOsVersionBlocked = true,
PartnerUnresponsivenessThresholdInDays = 6,
AllowPartnerToCollectIOSApplicationMetadata = true,
AllowPartnerToCollectIOSPersonalApplicationMetadata = true,
MicrosoftDefenderForEndpointAttachEnabled = 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.MobileThreatDefenseConnectors["{mobileThreatDefenseConnector-id}"].PatchAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc device-management mobile-threat-defense-connectors patch --mobile-threat-defense-connector-id {mobileThreatDefenseConnector-id} --body '{\
"@odata.type": "#microsoft.graph.mobileThreatDefenseConnector",\
"lastHeartbeatDateTime": "2016-12-31T23:59:37.9174975-08:00",\
"partnerState": "available",\
"androidMobileApplicationManagementEnabled": true,\
"iosMobileApplicationManagementEnabled": true,\
"androidEnabled": true,\
"iosEnabled": true,\
"windowsEnabled": true,\
"androidDeviceBlockedOnMissingPartnerData": true,\
"iosDeviceBlockedOnMissingPartnerData": true,\
"windowsDeviceBlockedOnMissingPartnerData": true,\
"partnerUnsupportedOsVersionBlocked": true,\
"partnerUnresponsivenessThresholdInDays": 6,\
"allowPartnerToCollectIOSApplicationMetadata": true,\
"allowPartnerToCollectIOSPersonalApplicationMetadata": true,\
"microsoftDefenderForEndpointAttachEnabled": true\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMobileThreatDefenseConnector()
lastHeartbeatDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:59:37.9174975-08:00")
requestBody.SetLastHeartbeatDateTime(&lastHeartbeatDateTime)
partnerState := graphmodels.AVAILABLE_MOBILETHREATPARTNERTENANTSTATE
requestBody.SetPartnerState(&partnerState)
androidMobileApplicationManagementEnabled := true
requestBody.SetAndroidMobileApplicationManagementEnabled(&androidMobileApplicationManagementEnabled)
iosMobileApplicationManagementEnabled := true
requestBody.SetIosMobileApplicationManagementEnabled(&iosMobileApplicationManagementEnabled)
androidEnabled := true
requestBody.SetAndroidEnabled(&androidEnabled)
iosEnabled := true
requestBody.SetIosEnabled(&iosEnabled)
windowsEnabled := true
requestBody.SetWindowsEnabled(&windowsEnabled)
androidDeviceBlockedOnMissingPartnerData := true
requestBody.SetAndroidDeviceBlockedOnMissingPartnerData(&androidDeviceBlockedOnMissingPartnerData)
iosDeviceBlockedOnMissingPartnerData := true
requestBody.SetIosDeviceBlockedOnMissingPartnerData(&iosDeviceBlockedOnMissingPartnerData)
windowsDeviceBlockedOnMissingPartnerData := true
requestBody.SetWindowsDeviceBlockedOnMissingPartnerData(&windowsDeviceBlockedOnMissingPartnerData)
partnerUnsupportedOsVersionBlocked := true
requestBody.SetPartnerUnsupportedOsVersionBlocked(&partnerUnsupportedOsVersionBlocked)
partnerUnresponsivenessThresholdInDays := int32(6)
requestBody.SetPartnerUnresponsivenessThresholdInDays(&partnerUnresponsivenessThresholdInDays)
allowPartnerToCollectIOSApplicationMetadata := true
requestBody.SetAllowPartnerToCollectIOSApplicationMetadata(&allowPartnerToCollectIOSApplicationMetadata)
allowPartnerToCollectIOSPersonalApplicationMetadata := true
requestBody.SetAllowPartnerToCollectIOSPersonalApplicationMetadata(&allowPartnerToCollectIOSPersonalApplicationMetadata)
microsoftDefenderForEndpointAttachEnabled := true
requestBody.SetMicrosoftDefenderForEndpointAttachEnabled(µsoftDefenderForEndpointAttachEnabled)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
mobileThreatDefenseConnectors, err := graphClient.DeviceManagement().MobileThreatDefenseConnectors().ByMobileThreatDefenseConnectorId("mobileThreatDefenseConnector-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);
MobileThreatDefenseConnector mobileThreatDefenseConnector = new MobileThreatDefenseConnector();
mobileThreatDefenseConnector.setOdataType("#microsoft.graph.mobileThreatDefenseConnector");
OffsetDateTime lastHeartbeatDateTime = OffsetDateTime.parse("2016-12-31T23:59:37.9174975-08:00");
mobileThreatDefenseConnector.setLastHeartbeatDateTime(lastHeartbeatDateTime);
mobileThreatDefenseConnector.setPartnerState(MobileThreatPartnerTenantState.Available);
mobileThreatDefenseConnector.setAndroidMobileApplicationManagementEnabled(true);
mobileThreatDefenseConnector.setIosMobileApplicationManagementEnabled(true);
mobileThreatDefenseConnector.setAndroidEnabled(true);
mobileThreatDefenseConnector.setIosEnabled(true);
mobileThreatDefenseConnector.setWindowsEnabled(true);
mobileThreatDefenseConnector.setAndroidDeviceBlockedOnMissingPartnerData(true);
mobileThreatDefenseConnector.setIosDeviceBlockedOnMissingPartnerData(true);
mobileThreatDefenseConnector.setWindowsDeviceBlockedOnMissingPartnerData(true);
mobileThreatDefenseConnector.setPartnerUnsupportedOsVersionBlocked(true);
mobileThreatDefenseConnector.setPartnerUnresponsivenessThresholdInDays(6);
mobileThreatDefenseConnector.setAllowPartnerToCollectIOSApplicationMetadata(true);
mobileThreatDefenseConnector.setAllowPartnerToCollectIOSPersonalApplicationMetadata(true);
mobileThreatDefenseConnector.setMicrosoftDefenderForEndpointAttachEnabled(true);
MobileThreatDefenseConnector result = graphClient.deviceManagement().mobileThreatDefenseConnectors().byMobileThreatDefenseConnectorId("{mobileThreatDefenseConnector-id}").patch(mobileThreatDefenseConnector);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const mobileThreatDefenseConnector = {
'@odata.type': '#microsoft.graph.mobileThreatDefenseConnector',
lastHeartbeatDateTime: '2016-12-31T23:59:37.9174975-08:00',
partnerState: 'available',
androidMobileApplicationManagementEnabled: true,
iosMobileApplicationManagementEnabled: true,
androidEnabled: true,
iosEnabled: true,
windowsEnabled: true,
androidDeviceBlockedOnMissingPartnerData: true,
iosDeviceBlockedOnMissingPartnerData: true,
windowsDeviceBlockedOnMissingPartnerData: true,
partnerUnsupportedOsVersionBlocked: true,
partnerUnresponsivenessThresholdInDays: 6,
allowPartnerToCollectIOSApplicationMetadata: true,
allowPartnerToCollectIOSPersonalApplicationMetadata: true,
microsoftDefenderForEndpointAttachEnabled: true
};
await client.api('/deviceManagement/mobileThreatDefenseConnectors/{mobileThreatDefenseConnectorId}')
.update(mobileThreatDefenseConnector);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MobileThreatDefenseConnector;
use Microsoft\Graph\Generated\Models\MobileThreatPartnerTenantState;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MobileThreatDefenseConnector();
$requestBody->setOdataType('#microsoft.graph.mobileThreatDefenseConnector');
$requestBody->setLastHeartbeatDateTime(new \DateTime('2016-12-31T23:59:37.9174975-08:00'));
$requestBody->setPartnerState(new MobileThreatPartnerTenantState('available'));
$requestBody->setAndroidMobileApplicationManagementEnabled(true);
$requestBody->setIosMobileApplicationManagementEnabled(true);
$requestBody->setAndroidEnabled(true);
$requestBody->setIosEnabled(true);
$requestBody->setWindowsEnabled(true);
$requestBody->setAndroidDeviceBlockedOnMissingPartnerData(true);
$requestBody->setIosDeviceBlockedOnMissingPartnerData(true);
$requestBody->setWindowsDeviceBlockedOnMissingPartnerData(true);
$requestBody->setPartnerUnsupportedOsVersionBlocked(true);
$requestBody->setPartnerUnresponsivenessThresholdInDays(6);
$requestBody->setAllowPartnerToCollectIOSApplicationMetadata(true);
$requestBody->setAllowPartnerToCollectIOSPersonalApplicationMetadata(true);
$requestBody->setMicrosoftDefenderForEndpointAttachEnabled(true);
$result = $graphServiceClient->deviceManagement()->mobileThreatDefenseConnectors()->byMobileThreatDefenseConnectorId('mobileThreatDefenseConnector-id')->patch($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.mobileThreatDefenseConnector"
lastHeartbeatDateTime = [System.DateTime]::Parse("2016-12-31T23:59:37.9174975-08:00")
partnerState = "available"
androidMobileApplicationManagementEnabled = $true
iosMobileApplicationManagementEnabled = $true
androidEnabled = $true
iosEnabled = $true
windowsEnabled = $true
androidDeviceBlockedOnMissingPartnerData = $true
iosDeviceBlockedOnMissingPartnerData = $true
windowsDeviceBlockedOnMissingPartnerData = $true
partnerUnsupportedOsVersionBlocked = $true
partnerUnresponsivenessThresholdInDays = 6
allowPartnerToCollectIOSApplicationMetadata = $true
allowPartnerToCollectIOSPersonalApplicationMetadata = $true
microsoftDefenderForEndpointAttachEnabled = $true
}
Update-MgDeviceManagementMobileThreatDefenseConnector -MobileThreatDefenseConnectorId $mobileThreatDefenseConnectorId -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.mobile_threat_defense_connector import MobileThreatDefenseConnector
from msgraph.generated.models.mobile_threat_partner_tenant_state import MobileThreatPartnerTenantState
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MobileThreatDefenseConnector(
odata_type = "#microsoft.graph.mobileThreatDefenseConnector",
last_heartbeat_date_time = "2016-12-31T23:59:37.9174975-08:00",
partner_state = MobileThreatPartnerTenantState.Available,
android_mobile_application_management_enabled = True,
ios_mobile_application_management_enabled = True,
android_enabled = True,
ios_enabled = True,
windows_enabled = True,
android_device_blocked_on_missing_partner_data = True,
ios_device_blocked_on_missing_partner_data = True,
windows_device_blocked_on_missing_partner_data = True,
partner_unsupported_os_version_blocked = True,
partner_unresponsiveness_threshold_in_days = 6,
allow_partner_to_collect_i_o_s_application_metadata = True,
allow_partner_to_collect_i_o_s_personal_application_metadata = True,
microsoft_defender_for_endpoint_attach_enabled = True,
)
result = await graph_client.device_management.mobile_threat_defense_connectors.by_mobile_threat_defense_connector_id('mobileThreatDefenseConnector-id').patch(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。