Unable to Retrieve Members Not Synced from On-Premises Using Microsoft Graph API.

Bryn, Robert L 41 Reputation points
2023-12-01T15:34:48.9966667+00:00

I have a requirement to find all users in EntraID that are UserType "member" and are NOT Synced from on-premises. It doesn't appear that I can find users with null values. or not equals to true.

I've tried

https://graph.microsoft.com/v1.0/users?$filter=usertype eq 'Member' and onPremisesSyncEnabled+ne+true&$count=true

*fails with an error

    "error": {
        "code": "Request_UnsupportedQuery",
        "message": "Filter operator 'NotEqualsMatch' is not supported.",
  

if I try checking for null using the query below, it throws a different error

https://graph.microsoft.com/v1.0/users?$filter=usertype eq 'Member' and onPremisesSyncEnabled+eq+null&$count=true

.

  "error": {

        "code": "Request_UnsupportedQuery",
        "message": "Unsupported or invalid query filter clause specified for property 'onPremisesSyncEnabled' of resource 'User'.",

Is there something I'm missing?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,315 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,444 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful