首页 > 解决方案 > 图表 - 更新 intune 合规性状态

问题描述

目标是根据本文更新 Intune 合规性状态:https ://docs.microsoft.com/en-us/graph/api/intune-devices-manageddevice-update?view=graph-rest-1.0

我的代码片段如下:

ManagedDevice md = new ManagedDevice
                    {
                        ComplianceState = ComplianceState.Noncompliant
                    };
    
                    await 
    graphClient.DeviceManagement.ManagedDevices[deviceid].Request().UpdateAsync(md);

我也无法通过图形资源管理器执行此操作,在这种情况下,请求是带有 body 的“补丁”:

{“合规状态”:“不合规”}

I get the same error in code and GraphExplorer as below, permissions granted are: 
    DeviceManagementManagedDevices.ReadWrite.All

    rror": {
            "code": "InternalError",
            "message": "{  \"_version\": 3,  \"Message\": \"An error has occurred - Operation ID (for 
    customer support): 00000000-0000-0000-0000-000000000000 - Activity ID:

标签: graph

解决方案


推荐阅读