Udo Schiefer
Udo Schiefer

Reputation: 13

Get all user (+ direct manager, photo meta data and properties like 'AboutMe')

Until now we used a SharePoint on-premise custom web service which delivered all users (approx 15,000) inclusive properties like aboutMe, skills, etc. and the direct manager. That job took approx. 15 minutes. All the data was stored in a Lucene search index.

Now we have to switch to O365. I am able to get all the desired information from Microsoft Graph but it would take way too long (3 - 5 hours):

Is there any efficient way to do that task?

Upvotes: 0

Views: 327

Answers (1)

Marc LaFleur
Marc LaFleur

Reputation: 33124

Ideally, you should just call Microsoft Graph for the data you want on-demand rather than attempting to sync it to your own database.

Assuming you can't do that, you can deduce the time this takes using /delta endpoint (Get incremental changes for users). When you use a delta token, you will only get back resources that have changed (adds, deletes, edits) since your previous request. So your first pass might take a few hours, but subsequent passes should take seconds.

You can control which properties you're "tracking changes" against using the $select query parameter. For example, if you only care about changes to the displayName then using /v1.0/users/delta?$select=displayName will ensure you only receive changes to that property. From the documentation:

If a $select query parameter is used, the parameter indicates that the client prefers to only track changes on the properties or relationships specified in the $select statement. If a change occurs to a property that is not selected, the resource for which that property changed does not appear in the delta response after a subsequent request.

Also, consider batching requests to improve your processes' overall performance. Batching allows you to send multiple queries to Microsoft Graph in a single request and get the complete results back in a single response.

Upvotes: 1

Related Questions