Search code examples
azure-active-directorymicrosoft-graph-apiodatamicrosoft-graph-sdks

Read users of 'Room' type from AAD


What is the graph query to read users from AAD that are rooms and match a particular room type for example Conference Rooms, Reserved Space?

For example:

https://graph.tenant.com/v1.0/users?$count=true&$search="displayName:room"&$filter=endsWith(mail,'tenant.com')&$orderBy=displayName&$select=id,displayName,mail

On trying the above query, I see UnsupportedQuery error.


Solution

  • Set the ConsistencyLevel header to eventual .

    Then your query

    https://graph.microsoft.com/v1.0/users?$count=true&$search="displayName:room"&$filter=endsWith(mail,'tenant.com')&$orderBy=displayName&$select=id,displayName,mail
    

    should work

    Resources:

    Advanced queries