Namespace: microsoft.graph
Hinweis: Die Microsoft Graph-API für Intune setzt eine aktive Intune-Lizenz für den Mandanten voraus.
Aktualisieren sie die Eigenschaften eines managedDeviceMobileAppConfigurationDeviceStatus-Objekts .
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) |
DeviceManagementApps.ReadWrite.All |
Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Anwendung |
DeviceManagementApps.ReadWrite.All |
HTTP-Anforderung
PATCH /deviceAppManagement/mobileAppConfigurations/{managedDeviceMobileAppConfigurationId}/deviceStatuses/{managedDeviceMobileAppConfigurationDeviceStatusId}
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung für das managedDeviceMobileAppConfigurationDeviceStatus-Objekt an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die beim Erstellen von managedDeviceMobileAppConfigurationDeviceStatus erforderlich sind.
Eigenschaft |
Typ |
Beschreibung |
id |
String |
Schlüssel der Entität |
deviceDisplayName |
String |
Gerätename, der dem Objekt des Typs „DevicePolicyStatus“ zugeordnet ist |
userName |
String |
Gemeldeter Benutzername |
deviceModel |
String |
Gemeldetes Gerätemodell |
complianceGracePeriodExpirationDateTime |
DateTimeOffset |
Datum und Uhrzeit des Ablaufs der Karenzzeit für die Gerätekonformität |
status |
complianceStatus |
Konformitätsstatus des Richtlinienberichts. Mögliche Werte: unknown , notApplicable , compliant , remediated , nonCompliant , error , conflict , notAssigned . |
lastReportedDateTime |
DateTimeOffset |
Datum und Uhrzeit der letzten Änderung des Richtlinienberichts |
userPrincipalName |
String |
Benutzerprinzipalname |
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 200 OK
Antwortcode und ein aktualisiertes objekt managedDeviceMobileAppConfigurationDeviceStatus im Antworttext zurück.
Beispiel
Anforderung
Nachfolgend sehen Sie ein Beispiel der Anforderung.
PATCH https://graph.microsoft.com/v1.0/deviceAppManagement/mobileAppConfigurations/{managedDeviceMobileAppConfigurationId}/deviceStatuses/{managedDeviceMobileAppConfigurationDeviceStatusId}
Content-type: application/json
Content-length: 445
{
"@odata.type": "#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus",
"deviceDisplayName": "Device Display Name value",
"userName": "User Name value",
"deviceModel": "Device Model value",
"complianceGracePeriodExpirationDateTime": "2016-12-31T23:56:44.951111-08:00",
"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 ManagedDeviceMobileAppConfigurationDeviceStatus
{
OdataType = "#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus",
DeviceDisplayName = "Device Display Name value",
UserName = "User Name value",
DeviceModel = "Device Model value",
ComplianceGracePeriodExpirationDateTime = DateTimeOffset.Parse("2016-12-31T23:56:44.951111-08:00"),
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://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.MobileAppConfigurations["{managedDeviceMobileAppConfiguration-id}"].DeviceStatuses["{managedDeviceMobileAppConfigurationDeviceStatus-id}"].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-app-management mobile-app-configurations device-statuses patch --managed-device-mobile-app-configuration-id {managedDeviceMobileAppConfiguration-id} --managed-device-mobile-app-configuration-device-status-id {managedDeviceMobileAppConfigurationDeviceStatus-id} --body '{\
"@odata.type": "#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus",\
"deviceDisplayName": "Device Display Name value",\
"userName": "User Name value",\
"deviceModel": "Device Model value",\
"complianceGracePeriodExpirationDateTime": "2016-12-31T23:56:44.951111-08:00",\
"status": "notApplicable",\
"lastReportedDateTime": "2017-01-01T00:00:17.7769392-08:00",\
"userPrincipalName": "User Principal Name value"\
}\
'
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"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewManagedDeviceMobileAppConfigurationDeviceStatus()
deviceDisplayName := "Device Display Name value"
requestBody.SetDeviceDisplayName(&deviceDisplayName)
userName := "User Name value"
requestBody.SetUserName(&userName)
deviceModel := "Device Model value"
requestBody.SetDeviceModel(&deviceModel)
complianceGracePeriodExpirationDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:56:44.951111-08:00")
requestBody.SetComplianceGracePeriodExpirationDateTime(&complianceGracePeriodExpirationDateTime)
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://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
deviceStatuses, err := graphClient.DeviceAppManagement().MobileAppConfigurations().ByManagedDeviceMobileAppConfigurationId("managedDeviceMobileAppConfiguration-id").DeviceStatuses().ByManagedDeviceMobileAppConfigurationDeviceStatusId("managedDeviceMobileAppConfigurationDeviceStatus-id").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);
ManagedDeviceMobileAppConfigurationDeviceStatus managedDeviceMobileAppConfigurationDeviceStatus = new ManagedDeviceMobileAppConfigurationDeviceStatus();
managedDeviceMobileAppConfigurationDeviceStatus.setOdataType("#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus");
managedDeviceMobileAppConfigurationDeviceStatus.setDeviceDisplayName("Device Display Name value");
managedDeviceMobileAppConfigurationDeviceStatus.setUserName("User Name value");
managedDeviceMobileAppConfigurationDeviceStatus.setDeviceModel("Device Model value");
OffsetDateTime complianceGracePeriodExpirationDateTime = OffsetDateTime.parse("2016-12-31T23:56:44.951111-08:00");
managedDeviceMobileAppConfigurationDeviceStatus.setComplianceGracePeriodExpirationDateTime(complianceGracePeriodExpirationDateTime);
managedDeviceMobileAppConfigurationDeviceStatus.setStatus(ComplianceStatus.NotApplicable);
OffsetDateTime lastReportedDateTime = OffsetDateTime.parse("2017-01-01T00:00:17.7769392-08:00");
managedDeviceMobileAppConfigurationDeviceStatus.setLastReportedDateTime(lastReportedDateTime);
managedDeviceMobileAppConfigurationDeviceStatus.setUserPrincipalName("User Principal Name value");
ManagedDeviceMobileAppConfigurationDeviceStatus result = graphClient.deviceAppManagement().mobileAppConfigurations().byManagedDeviceMobileAppConfigurationId("{managedDeviceMobileAppConfiguration-id}").deviceStatuses().byManagedDeviceMobileAppConfigurationDeviceStatusId("{managedDeviceMobileAppConfigurationDeviceStatus-id}").patch(managedDeviceMobileAppConfigurationDeviceStatus);
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 managedDeviceMobileAppConfigurationDeviceStatus = {
'@odata.type': '#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus',
deviceDisplayName: 'Device Display Name value',
userName: 'User Name value',
deviceModel: 'Device Model value',
complianceGracePeriodExpirationDateTime: '2016-12-31T23:56:44.951111-08:00',
status: 'notApplicable',
lastReportedDateTime: '2017-01-01T00:00:17.7769392-08:00',
userPrincipalName: 'User Principal Name value'
};
await client.api('/deviceAppManagement/mobileAppConfigurations/{managedDeviceMobileAppConfigurationId}/deviceStatuses/{managedDeviceMobileAppConfigurationDeviceStatusId}')
.update(managedDeviceMobileAppConfigurationDeviceStatus);
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\ManagedDeviceMobileAppConfigurationDeviceStatus;
use Microsoft\Graph\Generated\Models\ComplianceStatus;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ManagedDeviceMobileAppConfigurationDeviceStatus();
$requestBody->setOdataType('#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus');
$requestBody->setDeviceDisplayName('Device Display Name value');
$requestBody->setUserName('User Name value');
$requestBody->setDeviceModel('Device Model value');
$requestBody->setComplianceGracePeriodExpirationDateTime(new \DateTime('2016-12-31T23:56:44.951111-08:00'));
$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->deviceAppManagement()->mobileAppConfigurations()->byManagedDeviceMobileAppConfigurationId('managedDeviceMobileAppConfiguration-id')->deviceStatuses()->byManagedDeviceMobileAppConfigurationDeviceStatusId('managedDeviceMobileAppConfigurationDeviceStatus-id')->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.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus"
deviceDisplayName = "Device Display Name value"
userName = "User Name value"
deviceModel = "Device Model value"
complianceGracePeriodExpirationDateTime = [System.DateTime]::Parse("2016-12-31T23:56:44.951111-08:00")
status = "notApplicable"
lastReportedDateTime = [System.DateTime]::Parse("2017-01-01T00:00:17.7769392-08:00")
userPrincipalName = "User Principal Name value"
}
Update-MgDeviceAppManagementMobileAppConfigurationDeviceStatus -ManagedDeviceMobileAppConfigurationId $managedDeviceMobileAppConfigurationId -ManagedDeviceMobileAppConfigurationDeviceStatusId $managedDeviceMobileAppConfigurationDeviceStatusId -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.managed_device_mobile_app_configuration_device_status import ManagedDeviceMobileAppConfigurationDeviceStatus
from msgraph.generated.models.compliance_status import ComplianceStatus
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ManagedDeviceMobileAppConfigurationDeviceStatus(
odata_type = "#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus",
device_display_name = "Device Display Name value",
user_name = "User Name value",
device_model = "Device Model value",
compliance_grace_period_expiration_date_time = "2016-12-31T23:56:44.951111-08:00",
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_app_management.mobile_app_configurations.by_managed_device_mobile_app_configuration_id('managedDeviceMobileAppConfiguration-id').device_statuses.by_managed_device_mobile_app_configuration_device_status_id('managedDeviceMobileAppConfigurationDeviceStatus-id').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: 494
{
"@odata.type": "#microsoft.graph.managedDeviceMobileAppConfigurationDeviceStatus",
"id": "477d3651-3651-477d-5136-7d4751367d47",
"deviceDisplayName": "Device Display Name value",
"userName": "User Name value",
"deviceModel": "Device Model value",
"complianceGracePeriodExpirationDateTime": "2016-12-31T23:56:44.951111-08:00",
"status": "notApplicable",
"lastReportedDateTime": "2017-01-01T00:00:17.7769392-08:00",
"userPrincipalName": "User Principal Name value"
}