Hi everyone,
I’m running into an issue when using the ne (not equal) operator in Microsoft Graph queries—specifically when filtering managedDevices by the deviceCategoryDisplayName field.
I’m attempting to run the following query in Graph Explorer:
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?
$filter=(deviceCategoryDisplayName ne 'Waiting for Disposal')
&$select=deviceCategoryDisplayName,enrolledDateTime,managedDeviceName
Graph Explorer flags the filter as an error, but if I ignore the warning and run the query anyway, the results return devices that match “Waiting for Disposal”, instead of excluding them. In other words, the ne operator behaves as if it were eq.
The response looks like this:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices(deviceCategoryDisplayName,enrolledDateTime,managedDeviceName)",
"@odata.count": 1,
"value": [
{
"deviceCategoryDisplayName": "Waiting for Disposal",
"enrolledDateTime": "2025-02-09T06:29:00Z",
"managedDeviceName": "Windows VM"
}
]
}
Expected behavior: — Return all devices except those with deviceCategoryDisplayName = "Waiting for Disposal".
Actual behavior: — Returns devices with that value.
I’ve also confirmed:
The field is filterable.
Other operators (e.g., eq) work correctly.
The issue occurs both in Graph Explorer and when calling the API programmatically.
Has anyone else encountered this? Is this a known bug with the ne operator or is there something I’m missing about how filtering works on this resource type?
Any insights would be greatly appreciated!
Thanks!