Author Posts

February 3, 2017 at 9:52 pm

Working on a script to get Mobile info from users on Office 365. MS throttles the session and script errors out before finishing (MS closes the remote session).

I get all users on an array $mobile=Get-MobileDevice; Foreach ($phone in $mobile) {getsomeinfo}

Any idea how can i run this script for 1000 users than Close and Reopen a session with 365 and continue where i left ?

Basically run the script on groups of users but track the users that are already processed.

February 5, 2017 at 5:51 pm

There's no automated paging, no. You're going to have to figure out a way to segment your users on your own, such as querying those whose names start with "A," then "B," or some other segmentation. I suspect that using Select-Object's -First and -Skip parameters will still eventually time out.