MS Graph API: contains filters does not work on property serialNumber of deviceManagement/managedDevices

Gabriel Guillem Barceló Soteras 0 Reputation points
2023-11-16T08:04:23.67+00:00

The following query fails on 1.0 and beta endpoints, it returns 200 OK with empty data if serial number is partial.

GET https://graph.microsoft.com/beta/deviceManagement/managedDevices?$filter=contains(serialNumber,'ABC')

If full serial number is provided, it returns a single device successfully (it behaves like eq operator).

Tried with other properties like deviceName and it works flawlessly: https://graph.microsoft.com/beta/deviceManagement/managedDevices?$filter=contains(deviceName,'a')

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,882 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,992 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal-MSFT 48,081 Reputation points Microsoft Vendor
    2023-11-17T01:43:59.2233333+00:00

    @Gabriel Guillem Barceló Soteras, Thanks for posting in Q&A. Based on my testing, I find it can work in my environment. I can get the device information with the serial number. Here is the screenshot for your reference

    User's image

    You can change to other serial number to see if it can query. Or open a new Graph Explorer to see if the result will be different.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.