Для вызова этого API требуется одно из следующих разрешений. Дополнительные сведения, включая сведения о том, как выбрать разрешения, см. в статье Разрешения.
Тип разрешения
Разрешения (в порядке повышения привилегий)
Делегированные (рабочая или учебная учетная запись)
POST /deviceManagement/managedDevices/{managedDeviceId}/wipe
POST /deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/wipe
POST /deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/users/{userId}/managedDevices/{managedDeviceId}/wipe
POST https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDeviceId}/wipe
Content-type: application/json
Content-length: 141
{
"keepEnrollmentData": true,
"keepUserData": true,
"macOsUnlockCode": "Mac Os Unlock Code value",
"persistEsimDataPlan": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.DeviceManagement.ManagedDevices.Item.Wipe;
var requestBody = new WipePostRequestBody
{
KeepEnrollmentData = true,
KeepUserData = true,
MacOsUnlockCode = "Mac Os Unlock Code value",
PersistEsimDataPlan = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.DeviceManagement.ManagedDevices["{managedDevice-id}"].Wipe.PostAsync(requestBody);
// 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"
graphdevicemanagement "github.com/microsoftgraph/msgraph-sdk-go/devicemanagement"
//other-imports
)
requestBody := graphdevicemanagement.NewWipePostRequestBody()
keepEnrollmentData := true
requestBody.SetKeepEnrollmentData(&keepEnrollmentData)
keepUserData := true
requestBody.SetKeepUserData(&keepUserData)
macOsUnlockCode := "Mac Os Unlock Code value"
requestBody.SetMacOsUnlockCode(&macOsUnlockCode)
persistEsimDataPlan := true
requestBody.SetPersistEsimDataPlan(&persistEsimDataPlan)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.DeviceManagement().ManagedDevices().ByManagedDeviceId("managedDevice-id").Wipe().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.devicemanagement.manageddevices.item.wipe.WipePostRequestBody wipePostRequestBody = new com.microsoft.graph.devicemanagement.manageddevices.item.wipe.WipePostRequestBody();
wipePostRequestBody.setKeepEnrollmentData(true);
wipePostRequestBody.setKeepUserData(true);
wipePostRequestBody.setMacOsUnlockCode("Mac Os Unlock Code value");
wipePostRequestBody.setPersistEsimDataPlan(true);
graphClient.deviceManagement().managedDevices().byManagedDeviceId("{managedDevice-id}").wipe().post(wipePostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\DeviceManagement\ManagedDevices\Item\Wipe\WipePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new WipePostRequestBody();
$requestBody->setKeepEnrollmentData(true);
$requestBody->setKeepUserData(true);
$requestBody->setMacOsUnlockCode('Mac Os Unlock Code value');
$requestBody->setPersistEsimDataPlan(true);
$graphServiceClient->deviceManagement()->managedDevices()->byManagedDeviceId('managedDevice-id')->wipe()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.devicemanagement.manageddevices.item.wipe.wipe_post_request_body import WipePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = WipePostRequestBody(
keep_enrollment_data = True,
keep_user_data = True,
mac_os_unlock_code = "Mac Os Unlock Code value",
persist_esim_data_plan = True,
)
await graph_client.device_management.managed_devices.by_managed_device_id('managedDevice-id').wipe.post(request_body)
Ниже приведен пример отклика. Примечание. Представленный здесь объект отклика может быть усечен для краткости. При фактическом вызове будут возвращены все свойства.