Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie unter Berechtigungen.
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
DeviceManagementConfiguration.ReadWrite.All
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Anwendung
DeviceManagementConfiguration.ReadWrite.All
HTTP-Anforderung
POST /deviceManagement/deviceCompliancePolicies/{deviceCompliancePolicyId}/scheduledActionsForRule/{deviceComplianceScheduledActionForRuleId}/scheduledActionConfigurations
Geben Sie als Anforderungstext eine JSON-Darstellung des Objekt des Typs „deviceComplianceActionItem“ an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die angegeben werden müssen, wenn Sie ein Objekt des Typs „deviceComplianceActionItem“ erstellen.
Eigenschaft
Typ
Beschreibung
id
String
Schlüssel der Entität
gracePeriodHours
Int32
Die Anzahl der Stunden, bis die Aktion erzwungen wird. Gültige Werte: 0 bis 8760
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DeviceComplianceActionItem
{
OdataType = "#microsoft.graph.deviceComplianceActionItem",
GracePeriodHours = 0,
ActionType = DeviceComplianceActionType.Notification,
NotificationTemplateId = "Notification Template Id value",
NotificationMessageCCList = new List<string>
{
"Notification Message CCList value",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DeviceCompliancePolicies["{deviceCompliancePolicy-id}"].ScheduledActionsForRule["{deviceComplianceScheduledActionForRule-id}"].ScheduledActionConfigurations.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"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewDeviceComplianceActionItem()
gracePeriodHours := int32(0)
requestBody.SetGracePeriodHours(&gracePeriodHours)
actionType := graphmodels.NOTIFICATION_DEVICECOMPLIANCEACTIONTYPE
requestBody.SetActionType(&actionType)
notificationTemplateId := "Notification Template Id value"
requestBody.SetNotificationTemplateId(¬ificationTemplateId)
notificationMessageCCList := []string {
"Notification Message CCList value",
}
requestBody.SetNotificationMessageCCList(notificationMessageCCList)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
scheduledActionConfigurations, err := graphClient.DeviceManagement().DeviceCompliancePolicies().ByDeviceCompliancePolicyId("deviceCompliancePolicy-id").ScheduledActionsForRule().ByDeviceComplianceScheduledActionForRuleId("deviceComplianceScheduledActionForRule-id").ScheduledActionConfigurations().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DeviceComplianceActionItem deviceComplianceActionItem = new DeviceComplianceActionItem();
deviceComplianceActionItem.setOdataType("#microsoft.graph.deviceComplianceActionItem");
deviceComplianceActionItem.setGracePeriodHours(0);
deviceComplianceActionItem.setActionType(DeviceComplianceActionType.Notification);
deviceComplianceActionItem.setNotificationTemplateId("Notification Template Id value");
LinkedList<String> notificationMessageCCList = new LinkedList<String>();
notificationMessageCCList.add("Notification Message CCList value");
deviceComplianceActionItem.setNotificationMessageCCList(notificationMessageCCList);
DeviceComplianceActionItem result = graphClient.deviceManagement().deviceCompliancePolicies().byDeviceCompliancePolicyId("{deviceCompliancePolicy-id}").scheduledActionsForRule().byDeviceComplianceScheduledActionForRuleId("{deviceComplianceScheduledActionForRule-id}").scheduledActionConfigurations().post(deviceComplianceActionItem);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.device_compliance_action_item import DeviceComplianceActionItem
from msgraph.generated.models.device_compliance_action_type import DeviceComplianceActionType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeviceComplianceActionItem(
odata_type = "#microsoft.graph.deviceComplianceActionItem",
grace_period_hours = 0,
action_type = DeviceComplianceActionType.Notification,
notification_template_id = "Notification Template Id value",
notification_message_c_c_list = [
"Notification Message CCList value",
],
)
result = await graph_client.device_management.device_compliance_policies.by_device_compliance_policy_id('deviceCompliancePolicy-id').scheduled_actions_for_rule.by_device_compliance_scheduled_action_for_rule_id('deviceComplianceScheduledActionForRule-id').scheduled_action_configurations.post(request_body)
Nachfolgend sehen Sie ein Beispiel der Antwort. Hinweis: Das hier gezeigte Antwortobjekt ist möglicherweise aus Platzgründen abgeschnitten. Von einem tatsächlichen Aufruf werden alle Eigenschaften zurückgegeben.