How to Query OR condition in Graph API

67868880 106 Reputation points
2023-03-18T02:07:43.0433333+00:00

I am trying to run OR condition to find users with either of license assigned but its not working. Can someone please help to correct it ?

https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(x:x/skuId eq '18181a46-0d4e-45cd-891e-60aabd171b4e' or x/skuId eq '06ebc4ee-1bb5-47dd-8120-11324bc54e06')

Microsoft 365 and Office Install, redeem, activate For business Windows
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2023-03-18T07:41:40.4+00:00

    The below should work:

    https://graph.microsoft.com/beta/users?$filter=assignedLicenses/any(x:x/skuId+eq+18181a46-0d4e-45cd-891e-60aabd171b4e) or assignedLicenses/any(x:x/skuId+eq+06ebc4ee-1bb5-47dd-8120-11324bc54e06)&$count=true

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.