Estado de cumplimiento del informe de directiva. Los valores posibles son: unknown, notApplicable, compliant, remediated, nonCompliant, error, conflict y notAssigned.
lastReportedDateTime
DateTimeOffset
Fecha y hora de la última modificación del informe de directiva.
userPrincipalName
Cadena
UserPrincipalName.
Respuesta
Si se ejecuta correctamente, este método devuelve un código de respuesta 201 Created y un objeto deviceConfigurationUserStatus en el cuerpo de la respuesta.
POST https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/{deviceConfigurationId}/userStatuses
Content-type: application/json
Content-length: 290
{
"@odata.type": "#microsoft.graph.deviceConfigurationUserStatus",
"userDisplayName": "User Display Name value",
"devicesCount": 12,
"status": "notApplicable",
"lastReportedDateTime": "2017-01-01T00:00:17.7769392-08:00",
"userPrincipalName": "User Principal Name value"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DeviceConfigurationUserStatus
{
OdataType = "#microsoft.graph.deviceConfigurationUserStatus",
UserDisplayName = "User Display Name value",
DevicesCount = 12,
Status = ComplianceStatus.NotApplicable,
LastReportedDateTime = DateTimeOffset.Parse("2017-01-01T00:00:17.7769392-08:00"),
UserPrincipalName = "User Principal Name value",
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DeviceConfigurations["{deviceConfiguration-id}"].UserStatuses.PostAsync(requestBody);
// 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.NewDeviceConfigurationUserStatus()
userDisplayName := "User Display Name value"
requestBody.SetUserDisplayName(&userDisplayName)
devicesCount := int32(12)
requestBody.SetDevicesCount(&devicesCount)
status := graphmodels.NOTAPPLICABLE_COMPLIANCESTATUS
requestBody.SetStatus(&status)
lastReportedDateTime , err := time.Parse(time.RFC3339, "2017-01-01T00:00:17.7769392-08:00")
requestBody.SetLastReportedDateTime(&lastReportedDateTime)
userPrincipalName := "User Principal Name value"
requestBody.SetUserPrincipalName(&userPrincipalName)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
userStatuses, err := graphClient.DeviceManagement().DeviceConfigurations().ByDeviceConfigurationId("deviceConfiguration-id").UserStatuses().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DeviceConfigurationUserStatus deviceConfigurationUserStatus = new DeviceConfigurationUserStatus();
deviceConfigurationUserStatus.setOdataType("#microsoft.graph.deviceConfigurationUserStatus");
deviceConfigurationUserStatus.setUserDisplayName("User Display Name value");
deviceConfigurationUserStatus.setDevicesCount(12);
deviceConfigurationUserStatus.setStatus(ComplianceStatus.NotApplicable);
OffsetDateTime lastReportedDateTime = OffsetDateTime.parse("2017-01-01T00:00:17.7769392-08:00");
deviceConfigurationUserStatus.setLastReportedDateTime(lastReportedDateTime);
deviceConfigurationUserStatus.setUserPrincipalName("User Principal Name value");
DeviceConfigurationUserStatus result = graphClient.deviceManagement().deviceConfigurations().byDeviceConfigurationId("{deviceConfiguration-id}").userStatuses().post(deviceConfigurationUserStatus);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\DeviceConfigurationUserStatus;
use Microsoft\Graph\Generated\Models\ComplianceStatus;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DeviceConfigurationUserStatus();
$requestBody->setOdataType('#microsoft.graph.deviceConfigurationUserStatus');
$requestBody->setUserDisplayName('User Display Name value');
$requestBody->setDevicesCount(12);
$requestBody->setStatus(new ComplianceStatus('notApplicable'));
$requestBody->setLastReportedDateTime(new \DateTime('2017-01-01T00:00:17.7769392-08:00'));
$requestBody->setUserPrincipalName('User Principal Name value');
$result = $graphServiceClient->deviceManagement()->deviceConfigurations()->byDeviceConfigurationId('deviceConfiguration-id')->userStatuses()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.device_configuration_user_status import DeviceConfigurationUserStatus
from msgraph.generated.models.compliance_status import ComplianceStatus
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeviceConfigurationUserStatus(
odata_type = "#microsoft.graph.deviceConfigurationUserStatus",
user_display_name = "User Display Name value",
devices_count = 12,
status = ComplianceStatus.NotApplicable,
last_reported_date_time = "2017-01-01T00:00:17.7769392-08:00",
user_principal_name = "User Principal Name value",
)
result = await graph_client.device_management.device_configurations.by_device_configuration_id('deviceConfiguration-id').user_statuses.post(request_body)
Aquí tiene un ejemplo de la respuesta. Nota: Es posible que el objeto de respuesta que aparezca aquí esté truncado para abreviar. Todas las propiedades se devolverán desde una llamada real.
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 339
{
"@odata.type": "#microsoft.graph.deviceConfigurationUserStatus",
"id": "7e323db2-3db2-7e32-b23d-327eb23d327e",
"userDisplayName": "User Display Name value",
"devicesCount": 12,
"status": "notApplicable",
"lastReportedDateTime": "2017-01-01T00:00:17.7769392-08:00",
"userPrincipalName": "User Principal Name value"
}