2017-05-24 101 views
0

呼叫Intune的蔚藍圖形API來創建deviceCompliancePolicyState返回400錯誤的請求

GET https://graph.microsoft.com/beta/managedDevices/dd9615c4-9d3b-4ece-9272-34a10e8fe908/ 

響應

{ 
     "@odata.context": "https://graph.microsoft.com/beta/$metadata#managedDevices/$entity", 
     "id": "dd9615c4-9d3b-4ece-9272-34a10e8fe908", 
     "userId": null, 
     "deviceName": "iPad Feb23", 
     "hardwareInformation": { 
     "serialNumber": null, 
     "totalStorageSpace": 0, 
     "freeStorageSpace": 0, 
     "imei": "", 
     "meid": null, 
     "manufacturer": null, 
     "model": null, 
     "phoneNumber": null, 
     "subscriberCarrier": null, 
     "cellularTechnology": null, 
     "wifiMac": null, 
     "operatingSystemLanguage": null, 
     "isSupervised": false, 
     "isEncrypted": false, 
     "isSharedDevice": false, 
     "sharedDeviceCachedUsers": [] 
     }, 
     "ownerType": "personal", 
     "deviceActionResults": [], 
     "managementState": "managed", 
     "enrolledDateTime": "2017-05-24T13:10:20.8964572Z", 
     "lastSyncDateTime": "2017-05-24T15:16:02.6465376Z", 
     "chassisType": "tablet", 
     "operatingSystem": "iOS", 
     "deviceType": "iPad", 

    "complianceState": "compliant", 
    "jailBroken": "False", 
    "managementAgents": 2, 
    "managementAgent": "mdm", 
    "osVersion": "9.3.5", 
    "easActivated": false, 
    "easDeviceId": null, 
    "easActivationDateTime": "0001-01-01T00:00:00Z", 
    "aadRegistered": null, 
    "enrollmentType": "userEnrollmentWithServiceAccount", 
    "lostModeState": "disabled", 
    "activationLockBypassCode": null, 
    "emailAddress": null, 
    "azureActiveDirectoryDeviceId": "00000000-0000-0000-0000-000000000000", 
    "deviceRegistrationState": "registered", 
    "deviceCategoryDisplayName": null, 
    "isSupervised": false, 
    "exchangeLastSuccessfulSyncDateTime": "0001-01-01T00:00:00Z", 
    "exchangeAccessState": "none", 
    "exchangeAccessStateReason": "none", 
    "remoteAssistanceSessionUrl": "", 
    "isEncrypted": false, 
    "model": null, 
    "manufacturer": null 
} 

但是,當我嘗試做後似乎沒有任何工作...根據這裏的文檔https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/intune_mam_mobileappidentifierdeployment_create

它應該很好,這個電話的問題是什麼......?

呼叫

POST https://graph.microsoft.com/beta/managedDevices/dd9615c4-9d3b-4ece-9272-34a10e8fe908/deviceCompliancePolicyStates/ 

{ 
    "@odata.type": "#microsoft.graph.deviceCompliancePolicyState", 
    "settingStates": [ 
    { 
     "@odata.type": "microsoft.graph.deviceCompliancePolicySettingState", 
     "setting": "Setting value", 
     "instanceDisplayName": "Instance Display Name value", 
     "state": "notApplicable", 
     "errorCode": 9, 
     "errorDescription": "Error Description value", 
     "userPrincipalName": "User Principal Name value", 
     "sources": [ 
     { 
      "@odata.type": "microsoft.graph.settingSource", 
      "id": "Id value", 
      "displayName": "Display Name value" 
     } 
     ] 
    } 
    ], 
    "displayName": "Display Name value", 
    "version": 7, 
    "platformType": "androidForWork", 
    "state": "notApplicable", 
    "settingCount": 12 
} 

反應

{ 
    "error": { 
    "code": "No method match route template", 
    "message": "No OData route exists that match template ~/entityset/key/navigation with http verb POST for request /StatelessDeviceConfigurationFEService/managedDevices('dd9615c4-9d3b-4ece-9272-34a10e8fe908')/deviceCompliancePolicyStates.", 
    "innerError": { 
     "request-id": "544c4ee2-a6de-4203-9c30-c3e589b77713", 
     "date": "2017-05-24T15:48:30" 
    } 
    } 
} 

回答

0

我在微軟Intune的團隊的Microsoft Graph和Microsoft Intune的之間的整合,尤其致力於工程師。

在這種情況下,它看起來像文檔存在問題,因爲deviceCompliancePolicyState實體無法創建,它是顯示設備合規性策略狀態的只讀實體。我將努力糾正文檔。如果您可以通過創建deviceCompliancePolicyState實體讓我知道您嘗試完成的場景,那麼我可能會將您指向正確的方向。

希望幫助

彼得

+0

我工作的定製威脅defnece連接器有點事(https://docs.microsoft.com/en-us/intune-classic/deploy-use/mobile - 威脅防禦),我有一個設備上的自定義應用程序,檢查惡意軟件,... MITM ....並且當它檢測到一些惡意活動時,我會將deviceCompliancePolicy設置爲「nonComliant」,以便條件訪問踢並處理其餘部分,即阻止設備訪問服務。我試圖聯繫支持多次,我們如何能夠做到這一點,但無濟於事... – user3826273

+0

你能指點我現在正確的方向嗎? https://stackoverflow.com/questions/44176353/an-azure-app-how-to-send-device-threat-info-to-microsoft-intune – user3826273

相關問題