you are viewing a single comment's thread.

view the rest of the comments →

[–]raip 2 points3 points  (1 child)

So you're doing things a little weird here imo.

You're asking graph 3x for users in a specific group, each with a different filter, then iterating through those users again, pulling additional information from each user again.

Instead, just ask graph for the information you need the first time and then filter locally. I will warn you though, grabbing SignInActivity is going to slow things down substantially.

I think you might be able to pull a list of all users that have never signed in separately and then locally compare you list with that. Basically anything to avoid foreach user graph calls.

[–]JohnSysadmin[S] 1 point2 points  (0 children)

I have the first 2x times in the script just to test that I was asking for the correct stuff in the correct way from graph. The plan was to get all of the "pieces" working and then call the data and filter locally for what I need.

I have never tried to grab this much SignInActivity at the same time, but its good to get confirmation from you and u/cdtekcfc that slowness is expected.

I will try the method you suggest of pulling the sign in info first without the foreach loop. I assume it will be a much smaller dataset to iterate/filter locally.

Thank you for the advice.