1

We are currently working on a client application that processes Intune devices by querying all devices on a customer account using the following Microsoft Graph API:

GET https://graph.microsoft.com/v1.0/deviceManagement/managedDevices

After we migrated from our test environment to a Production account we discovered that manual pagination of devices using $skip and $top does not work as per the relevant Microsoft Graph API OData documentation.

As per the said documentation:

  • $skip: Indexes into a result set. Also used by some APIs to implement paging and can be used together with $top to manually page results.

However, the following query returns an empty result despite there being thousands of devices registered on the target customer account:

GET https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$top=10&$skip=10

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices",
    "@odata.count": 10,
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$top=10&$skip=10",
    "value": []
}

Also, we found that OData $filter does not work either as demonstrated by the following snippet which queries for devices with operatingSystem equal to 'Android':

GET 'https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$top=100&filter=operatingSystem%20eq%20%27Android%27'

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices",
    "@odata.count": 100,
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$top=100&$skip=0&filter=operatingSystem+eq+%27Android%27",
    "value": [
        {
            "id": "5bac965e-25e3-4f99-97fb-da21a280f684",
            "userId": "some-uuid-value",
            "deviceName": "My Iphone",
            "managedDeviceOwnerType": "company",
            "enrolledDateTime": "2020-02-05T09:52:39Z",
            "lastSyncDateTime": "2020-10-19T17:07:20Z",
            "operatingSystem": "iOS",
...

We have tested using both v1.0 and beta versions of the said API to no avail. Has anybody got this working?

Lex Luthor
  • 523
  • 6
  • 18
  • Usually I look at the documentation (instead of the generic documentation for oData) to validate whether the Graph call supports the oData queries or not and it had worked for me - you can check the other Graph API call documentation as well. In the same lines, I looked for the above calls, but i failed to see the they will support $top, $filter etc. Still if you believe this is an issue, please feel free to file bug for these API calls or you can consider filing support ticket with Microsoft to get further assistance. – Dev Oct 20 '20 at 14:10

0 Answers0