Unsupported Query. in Edge GE but not in Chrome

Gal, Ofer 81 Reputation points
2022-11-21T10:22:01.96+00:00

I ran "https://graph.microsoft.com/v1.0/users?$count=true&$filter=endsWith(mail,'@ecgmc.com') and jobTitle ne null" in Graph Explorer in Edge
Got an error "Unsupported Query."

Then ran the same in Chrome and got 572 results.
Then I copied the PowerShell code snippet

Import-Module Microsoft.Graph.Users  
Get-MgUser -CountVariable CountVar -Filter "endsWith(mail,'@ecgmc.com')" -ConsistencyLevel eventual  

and got error "Invalid filter clause"

why the difference? How can I get trusted results?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,380 questions
{count} votes

Accepted answer
  1. Harpreet Singh Matharoo 7,471 Reputation points Microsoft Employee
    2022-11-21T10:55:25.557+00:00

    Hello @Gal, Ofer

    Thank you for reaching out. I tried the query you shared, however there seems to be an issue with filter clause being used with endwith parameter. Correct Syntax for this query would be as follows: https://graph.microsoft.com/v1.0/users?$count=true&ConsistencyLevel=eventual&$filter=endsWith(mail,'@cloudezzy.com') and jobTitle ne null

    When running above query on Graph Explorer I was able to get results successfully on Chrome as well as Edge. Below are the outputs:

    On Edge
    262624-image.png

    On Chrome
    262625-image.png

    Additionally, the correct PowerShell Syntax would be as follows:

    Import-Module Microsoft.Graph.Users  
    Get-MgUser -CountVariable CountVar -Consistencylevel "eventual" -Filter "endsWith(mail,'@cloudezzy.com') and (jobTitle ne 'null')"  
    

    262567-image.png

    I hope this helps.

    ----------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful