1
votes

I'd failed to update the managed device category in Intune with Microsoft Graph. With the same code, I'd succeeded to update device owner. Parameter below:

URL: https://graph.microsoft.com/beta/deviceManagement/managedDevices('XXXXXXXXXX')

Failed request body:

{ "deviceCategoryDisplayName": "General Purpose" }

Succeeded request body:

{ "Owner": "Personal" }

"General Purpose" is a custom value. When failed, the server returns an error code and activity id.

How can I fix it?

1
I'd re-post it to Microsoft Tech Community, because it is an error! I'll be back when I would get an answer. Thanks! - techcommunity.microsoft.com/t5/Microsoft-Intune/…nayuta

1 Answers

0
votes

I've got the answer finally.

We should use odata.id to update the property. Like these,

URL: https://graph.microsoft.com/beta/deviceManagement/managedDevices('XXXXX-YOUR-INTUNE-DEVICE-GUID-XXXXX')
Method: PUT
Payload: {@odata.id: "https://graph.microsoft.com/beta/deviceManagement/deviceCategories/XXXXX-YOUR-DEVICE-CATEGROY-GUID-XXXX"}
Response code: 204

You will receive response code 204 when success to update. And, you cannot update other properties with it. It occurs error.

In the API documentation, it can update with string, but it is not correct. Maybe, it is not string property but refers to other objects. I think other objects referring property are the same, but not tested.

https://techcommunity.microsoft.com/t5/Microsoft-Intune/Update-Intune-Managed-Device-Category-with-Microsoft-Graph-were/m-p/366263/highlight/true#M1683