I need to get a users from Azure Active directory who were created/modified since a specific date. Is this possible, via graph or any other means?
I have checked the graph api documentation but cannot see a lastModified filter.
I need to get a users from Azure Active directory who were created/modified since a specific date. Is this possible, via graph or any other means?
I have checked the graph api documentation but cannot see a lastModified filter.
There is no such property called lastModifiedDateTime in Microsoft Graph.
As @Tiny Wang suggested, you can query using createdDateTime.
From Azure CLI, to get Azure AD users created since a specific date, make use of below command:
az ad user list --filter "createdDateTime ge datetime'yyyy-MM-ddTHH:mm:ssZ'"
From Microsoft Graph API, to get Azure AD users created since a specific date, make use of below command:
https://graph.microsoft.com/beta/users?$filter=createdDateTime ge yyyy-MM-ddTHH:mm:ssZ &$select=displayName,createdDateTime,id
Before using the above command, make sure to give the below permissions:
References:
As mentioned in the comment there is no modifiedDateTime or similar property on User resource type.
If you want to filter users who were created since a specific date then you can use createdDateTime property.
Example to get users created since 01/01/2022
GET /users?$filter=createdDateTime ge 2022-01-01T00:00:00Z
Example to get users created in 2021
GET /users?$filter=(createdDateTime ge 2021-01-01T00:00:00Z AND createdDateTime le 2021-12-31T23:59:59Z)