尝试通过 deviceCompliancePolicySettingStateSummaries 列出 intune 设备

Trying to list intune devices through deviceCompliancePolicySettingStateSummaries

我正在尝试使用 Microsoft Graph api 检索已注册设备的列表。经过身份验证的 GET 请求 https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicySettingStateSummaries

{
  "error": {
    "code": "UnknownError",
    "message": "{\"ErrorCode\":\"Forbidden\",\"Message\":\"{\r\n  \\"_version\\": 3,\r\n  \\"Message\\": \\"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: dd0e2f48-90b3-49e0-bb9a-b3b02e4b9482 - Url: https://fef.msua08.manage.microsoft.com/DeviceConfiguration_2005/StatelessDeviceConfigurationFEService/deviceManagement/deviceCompliancePolicySettingStateSummaries?api-version=2020-02-21\\",\r\n  \\"CustomApiErrorPhrase\\": \\"\\",\r\n  \\"RetryAfter\\": null,\r\n  \\"ErrorSourceService\\": \\"\\",\r\n  \\"HttpHeaders\\": \\"{\\\\"WWW-Authenticate\\\\":\\\\"Bearer realm=\\\\\\\\"urn:intune:service,bb7003b9-cb7f-44b2-b534-54f84f2f0d63,f0f3c450-59bf-4f0d-b1b2-0ef84ddfe3c7\\\\\\\\"\\\\"}\\"\r\n}\",\"Target\":null,\"Details\":null,\"InnerError\":null,\"InstanceAnnotations\":[]}",
    "innerError": {
      "request-id": "dd0e2f48-90b3-49e0-bb9a-b3b02e4b9482",
      "date": "2020-05-28T11:34:16"
    }
  }
}

我正在关注文档 here

我们只需要在 Azure AD 权限中添加这些资源权限 DeviceManagementConfiguration.ReadWrite.AllDeviceManagementConfiguration.Read.All