Namespace: microsoft.graph
Hinweis: Die Microsoft Graph-API für Intune setzt eine aktive Intune-Lizenz für den Mandanten voraus.
Diese Methode aktualisiert die Eigenschaften von Objekten des Typs deviceConfigurationDeviceStateSummary.
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
✅ |
✅ |
✅ |
✅ |
Berechtigungen
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
PATCH /deviceManagement/deviceConfigurationDeviceStateSummaries
Anforderungstext
Geben Sie als Anforderungstext eine JSON-Darstellung des Objekts des Typs deviceConfigurationDeviceStateSummary an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die angegeben werden müssen, wenn Sie ein Objekt des Typs deviceConfigurationDeviceStateSummary erstellen.
Eigenschaft |
Typ |
Beschreibung |
id |
String |
Schlüssel der Entität |
unknownDeviceCount |
Int32 |
Anzahl der unbekannten Geräte |
notApplicableDeviceCount |
Int32 |
Anzahl der ausgenommenen Geräte |
compliantDeviceCount |
Int32 |
Anzahl der konformen Geräte |
remediatedDeviceCount |
Int32 |
Anzahl der korrigierten Geräte |
nonCompliantDeviceCount |
Int32 |
Anzahl der nicht konformen Geräte |
errorDeviceCount |
Int32 |
Anzahl der fehlerhaften Geräte |
conflictDeviceCount |
Int32 |
Anzahl der Geräte mit Konflikten |
Antwort
Bei erfolgreicher Ausführung gibt die Methode den Antwortcode 200 OK
und ein aktualisiertes Objekt des Typs deviceConfigurationDeviceStateSummary im Antworttext zurück.
Beispiel
Anforderung
Nachfolgend sehen Sie ein Beispiel der Anforderung.
PATCH https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurationDeviceStateSummaries
Content-type: application/json
Content-length: 290
{
"@odata.type": "#microsoft.graph.deviceConfigurationDeviceStateSummary",
"unknownDeviceCount": 2,
"notApplicableDeviceCount": 8,
"compliantDeviceCount": 4,
"remediatedDeviceCount": 5,
"nonCompliantDeviceCount": 7,
"errorDeviceCount": 0,
"conflictDeviceCount": 3
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DeviceConfigurationDeviceStateSummary
{
OdataType = "#microsoft.graph.deviceConfigurationDeviceStateSummary",
UnknownDeviceCount = 2,
NotApplicableDeviceCount = 8,
CompliantDeviceCount = 4,
RemediatedDeviceCount = 5,
NonCompliantDeviceCount = 7,
ErrorDeviceCount = 0,
ConflictDeviceCount = 3,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DeviceConfigurationDeviceStateSummaries.PatchAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
mgc device-management device-configuration-device-state-summaries patch --body '{\
"@odata.type": "#microsoft.graph.deviceConfigurationDeviceStateSummary",\
"unknownDeviceCount": 2,\
"notApplicableDeviceCount": 8,\
"compliantDeviceCount": 4,\
"remediatedDeviceCount": 5,\
"nonCompliantDeviceCount": 7,\
"errorDeviceCount": 0,\
"conflictDeviceCount": 3\
}\
'
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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.NewDeviceConfigurationDeviceStateSummary()
unknownDeviceCount := int32(2)
requestBody.SetUnknownDeviceCount(&unknownDeviceCount)
notApplicableDeviceCount := int32(8)
requestBody.SetNotApplicableDeviceCount(¬ApplicableDeviceCount)
compliantDeviceCount := int32(4)
requestBody.SetCompliantDeviceCount(&compliantDeviceCount)
remediatedDeviceCount := int32(5)
requestBody.SetRemediatedDeviceCount(&remediatedDeviceCount)
nonCompliantDeviceCount := int32(7)
requestBody.SetNonCompliantDeviceCount(&nonCompliantDeviceCount)
errorDeviceCount := int32(0)
requestBody.SetErrorDeviceCount(&errorDeviceCount)
conflictDeviceCount := int32(3)
requestBody.SetConflictDeviceCount(&conflictDeviceCount)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
deviceConfigurationDeviceStateSummaries, err := graphClient.DeviceManagement().DeviceConfigurationDeviceStateSummaries().Patch(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DeviceConfigurationDeviceStateSummary deviceConfigurationDeviceStateSummary = new DeviceConfigurationDeviceStateSummary();
deviceConfigurationDeviceStateSummary.setOdataType("#microsoft.graph.deviceConfigurationDeviceStateSummary");
deviceConfigurationDeviceStateSummary.setUnknownDeviceCount(2);
deviceConfigurationDeviceStateSummary.setNotApplicableDeviceCount(8);
deviceConfigurationDeviceStateSummary.setCompliantDeviceCount(4);
deviceConfigurationDeviceStateSummary.setRemediatedDeviceCount(5);
deviceConfigurationDeviceStateSummary.setNonCompliantDeviceCount(7);
deviceConfigurationDeviceStateSummary.setErrorDeviceCount(0);
deviceConfigurationDeviceStateSummary.setConflictDeviceCount(3);
DeviceConfigurationDeviceStateSummary result = graphClient.deviceManagement().deviceConfigurationDeviceStateSummaries().patch(deviceConfigurationDeviceStateSummary);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
const options = {
authProvider,
};
const client = Client.init(options);
const deviceConfigurationDeviceStateSummary = {
'@odata.type': '#microsoft.graph.deviceConfigurationDeviceStateSummary',
unknownDeviceCount: 2,
notApplicableDeviceCount: 8,
compliantDeviceCount: 4,
remediatedDeviceCount: 5,
nonCompliantDeviceCount: 7,
errorDeviceCount: 0,
conflictDeviceCount: 3
};
await client.api('/deviceManagement/deviceConfigurationDeviceStateSummaries')
.update(deviceConfigurationDeviceStateSummary);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\DeviceConfigurationDeviceStateSummary;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DeviceConfigurationDeviceStateSummary();
$requestBody->setOdataType('#microsoft.graph.deviceConfigurationDeviceStateSummary');
$requestBody->setUnknownDeviceCount(2);
$requestBody->setNotApplicableDeviceCount(8);
$requestBody->setCompliantDeviceCount(4);
$requestBody->setRemediatedDeviceCount(5);
$requestBody->setNonCompliantDeviceCount(7);
$requestBody->setErrorDeviceCount(0);
$requestBody->setConflictDeviceCount(3);
$result = $graphServiceClient->deviceManagement()->deviceConfigurationDeviceStateSummaries()->patch($requestBody)->wait();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.deviceConfigurationDeviceStateSummary"
unknownDeviceCount = 2
notApplicableDeviceCount = 8
compliantDeviceCount = 4
remediatedDeviceCount = 5
nonCompliantDeviceCount = 7
errorDeviceCount = 0
conflictDeviceCount = 3
}
Update-MgDeviceManagementDeviceConfigurationDeviceStateSummary -BodyParameter $params
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.device_configuration_device_state_summary import DeviceConfigurationDeviceStateSummary
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeviceConfigurationDeviceStateSummary(
odata_type = "#microsoft.graph.deviceConfigurationDeviceStateSummary",
unknown_device_count = 2,
not_applicable_device_count = 8,
compliant_device_count = 4,
remediated_device_count = 5,
non_compliant_device_count = 7,
error_device_count = 0,
conflict_device_count = 3,
)
result = await graph_client.device_management.device_configuration_device_state_summaries.patch(request_body)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
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.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 339
{
"@odata.type": "#microsoft.graph.deviceConfigurationDeviceStateSummary",
"id": "5db26f5a-6f5a-5db2-5a6f-b25d5a6fb25d",
"unknownDeviceCount": 2,
"notApplicableDeviceCount": 8,
"compliantDeviceCount": 4,
"remediatedDeviceCount": 5,
"nonCompliantDeviceCount": 7,
"errorDeviceCount": 0,
"conflictDeviceCount": 3
}