Namespace: microsoft.graph
Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Create a new settingStateDeviceSummary object.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
✅ |
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type |
Permissions (from least to most privileged) |
Delegated (work or school account) |
DeviceManagementConfiguration.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported. |
Application |
DeviceManagementConfiguration.ReadWrite.All |
HTTP Request
POST /deviceManagement/deviceConfigurations/{deviceConfigurationId}/deviceSettingStateSummaries
POST /deviceManagement/deviceCompliancePolicies/{deviceCompliancePolicyId}/deviceSettingStateSummaries
Request body
In the request body, supply a JSON representation for the settingStateDeviceSummary object.
The following table shows the properties that are required when you create the settingStateDeviceSummary.
Property |
Type |
Description |
id |
String |
Key of the entity. |
settingName |
String |
Name of the setting |
instancePath |
String |
Name of the InstancePath for the setting |
unknownDeviceCount |
Int32 |
Device Unkown count for the setting |
notApplicableDeviceCount |
Int32 |
Device Not Applicable count for the setting |
compliantDeviceCount |
Int32 |
Device Compliant count for the setting |
remediatedDeviceCount |
Int32 |
Device Compliant count for the setting |
nonCompliantDeviceCount |
Int32 |
Device NonCompliant count for the setting |
errorDeviceCount |
Int32 |
Device error count for the setting |
conflictDeviceCount |
Int32 |
Device conflict error count for the setting |
Response
If successful, this method returns a 201 Created
response code and a settingStateDeviceSummary object in the response body.
Example
Request
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/{deviceConfigurationId}/deviceSettingStateSummaries
Content-type: application/json
Content-length: 360
{
"@odata.type": "#microsoft.graph.settingStateDeviceSummary",
"settingName": "Setting Name value",
"instancePath": "Instance Path value",
"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 SettingStateDeviceSummary
{
OdataType = "#microsoft.graph.settingStateDeviceSummary",
SettingName = "Setting Name value",
InstancePath = "Instance Path value",
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.DeviceConfigurations["{deviceConfiguration-id}"].DeviceSettingStateSummaries.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
mgc device-management device-configurations device-setting-state-summaries create --device-configuration-id {deviceConfiguration-id} --body '{\
"@odata.type": "#microsoft.graph.settingStateDeviceSummary",\
"settingName": "Setting Name value",\
"instancePath": "Instance Path value",\
"unknownDeviceCount": 2,\
"notApplicableDeviceCount": 8,\
"compliantDeviceCount": 4,\
"remediatedDeviceCount": 5,\
"nonCompliantDeviceCount": 7,\
"errorDeviceCount": 0,\
"conflictDeviceCount": 3\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// 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.NewSettingStateDeviceSummary()
settingName := "Setting Name value"
requestBody.SetSettingName(&settingName)
instancePath := "Instance Path value"
requestBody.SetInstancePath(&instancePath)
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
deviceSettingStateSummaries, err := graphClient.DeviceManagement().DeviceConfigurations().ByDeviceConfigurationId("deviceConfiguration-id").DeviceSettingStateSummaries().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
SettingStateDeviceSummary settingStateDeviceSummary = new SettingStateDeviceSummary();
settingStateDeviceSummary.setOdataType("#microsoft.graph.settingStateDeviceSummary");
settingStateDeviceSummary.setSettingName("Setting Name value");
settingStateDeviceSummary.setInstancePath("Instance Path value");
settingStateDeviceSummary.setUnknownDeviceCount(2);
settingStateDeviceSummary.setNotApplicableDeviceCount(8);
settingStateDeviceSummary.setCompliantDeviceCount(4);
settingStateDeviceSummary.setRemediatedDeviceCount(5);
settingStateDeviceSummary.setNonCompliantDeviceCount(7);
settingStateDeviceSummary.setErrorDeviceCount(0);
settingStateDeviceSummary.setConflictDeviceCount(3);
SettingStateDeviceSummary result = graphClient.deviceManagement().deviceConfigurations().byDeviceConfigurationId("{deviceConfiguration-id}").deviceSettingStateSummaries().post(settingStateDeviceSummary);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const settingStateDeviceSummary = {
'@odata.type': '#microsoft.graph.settingStateDeviceSummary',
settingName: 'Setting Name value',
instancePath: 'Instance Path value',
unknownDeviceCount: 2,
notApplicableDeviceCount: 8,
compliantDeviceCount: 4,
remediatedDeviceCount: 5,
nonCompliantDeviceCount: 7,
errorDeviceCount: 0,
conflictDeviceCount: 3
};
await client.api('/deviceManagement/deviceConfigurations/{deviceConfigurationId}/deviceSettingStateSummaries')
.post(settingStateDeviceSummary);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\SettingStateDeviceSummary;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SettingStateDeviceSummary();
$requestBody->setOdataType('#microsoft.graph.settingStateDeviceSummary');
$requestBody->setSettingName('Setting Name value');
$requestBody->setInstancePath('Instance Path value');
$requestBody->setUnknownDeviceCount(2);
$requestBody->setNotApplicableDeviceCount(8);
$requestBody->setCompliantDeviceCount(4);
$requestBody->setRemediatedDeviceCount(5);
$requestBody->setNonCompliantDeviceCount(7);
$requestBody->setErrorDeviceCount(0);
$requestBody->setConflictDeviceCount(3);
$result = $graphServiceClient->deviceManagement()->deviceConfigurations()->byDeviceConfigurationId('deviceConfiguration-id')->deviceSettingStateSummaries()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.settingStateDeviceSummary"
settingName = "Setting Name value"
instancePath = "Instance Path value"
unknownDeviceCount = 2
notApplicableDeviceCount = 8
compliantDeviceCount = 4
remediatedDeviceCount = 5
nonCompliantDeviceCount = 7
errorDeviceCount = 0
conflictDeviceCount = 3
}
New-MgDeviceManagementDeviceConfigurationDeviceSettingStateSummary -DeviceConfigurationId $deviceConfigurationId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.setting_state_device_summary import SettingStateDeviceSummary
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SettingStateDeviceSummary(
odata_type = "#microsoft.graph.settingStateDeviceSummary",
setting_name = "Setting Name value",
instance_path = "Instance Path value",
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_configurations.by_device_configuration_id('deviceConfiguration-id').device_setting_state_summaries.post(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
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.
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 409
{
"@odata.type": "#microsoft.graph.settingStateDeviceSummary",
"id": "3e2d4526-4526-3e2d-2645-2d3e26452d3e",
"settingName": "Setting Name value",
"instancePath": "Instance Path value",
"unknownDeviceCount": 2,
"notApplicableDeviceCount": 8,
"compliantDeviceCount": 4,
"remediatedDeviceCount": 5,
"nonCompliantDeviceCount": 7,
"errorDeviceCount": 0,
"conflictDeviceCount": 3
}