Lookup up devices using SN not working against /deviceManagement/managedDevices/
We would like to use GraphAPI to perform lookups of 'managed devices' using the serial number. For this, we simply follow the https://docs.microsoft.com/en-us/graph/api/intune-devices-manageddevice-get?view=graph-rest-1.0 article (where you say 'This method supports the OData Query Parameters to help customize the response.'), and the $filter parameter, like described at https://docs.microsoft.com/en-us/graph/query-parameters.
Let's say we want to run a query for all devices where SN starts with C02. We noticed that :
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices seems to work.
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$filter=startswith(serialnumber,'C02') does not work (0 results).
https://graph.microsoft.com/beta/deviceManagement/managedDevices?$filter=((contains(activationlockbypasscode, 'C02'))) seems to work, and also to fulfill our goal.
In the 2nd URL I provided, you explicitly mention that 'The contains string operator is currently not supported on any Microsoft Graph resources.', despite the fact that you are using it yourself in Azure GUI... It is also not clear why you are using 'activationlockbypasscode' inside your Azure GUI to allow lookups on a serial number?
Could you please fix the issue with $filter=startswith(serialnumber,'value'), when ran against /deviceManagement/managedDevices API call?
Alternatively, could you please provide the official and MS-supported way, on how to perform a REST API call against managed devices using a serial number?