Share via

Azure graph API for users doesn't support filter by createdDateTime anymore

Maluenda Miranda, Cristian G 121 Reputation points
2021-08-02T23:15:01.8+00:00

Hi,
We have a job that searches the users created between two dates. It was working fine until the last week. Suddenly, Microsoft decided to not support filters by "createdDateTime" for Users anymore, despite the documentation says it is supported (https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0).

Now, our job is broken and I need to find a walkaround to search the users created daily. I am not sure if the delta link will help me, because the job is stateless.

Regards,
Cristian.

Microsoft Security | Microsoft Graph

Answer accepted by question author

  1. Maluenda Miranda, Cristian G 121 Reputation points
    2021-08-25T20:03:13.703+00:00

    Microsoft fixes this issue, but it doesn't support just the date. It is necessary to include the time.
    Here is an example:

    https://graph.microsoft.com/v1.0/users?$filter=(createdDateTime ge 2021-07-01T00:00:00Z AND createdDateTime le 2021-08-01T00:00:00Z)
    

    It is not necessary to use any advanced query parameters!

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Danstan Onyango 3,996 Reputation points Microsoft Employee
    2021-08-03T15:45:26.927+00:00

    The filter requires the Advanced Query Options.

    To get it to work you need to add the count operator and the ConsistencyLevel=eventual. Example

    GET https://graph.microsoft.com/v1.0/users?$filter=createdDateTime eq 2021-04-06T08:03:07Z&$count=true  
    ConsistencyLevel: eventual  
    
    1 person found this answer helpful.

  2. PrasF12 1 Reputation point
    2021-08-18T18:48:56.327+00:00

    Please try this, I used your command and modified it a bit. It worked for me.

    https://graph.microsoft.com/v1.0/users?$filter=(createdDateTime ge 2021-07-01T00:00:00Z AND createdDateTime le 2021-08-01T00:00:00Z)&$count=true

    Make sure you're passing the header (ConsistencyLevel) as well.


Your answer

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