Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Paging a Large Output from Get-Mailbox to smaller Subsets to execute a command on

$
0
0

Currently I am working on an Office 365 project that the customer has over 45k Mailboxes created in the Cloud and the only way to bulk change anything is through PowerShell v2. When I try and do a Get-Mailbox -ResultSize unlimited it eventually bombs out at different points with different WinRM errors.

So what I want to do is the Get-Mailbox query and return say 100 mailboxes, execute some commands on those, then grab the next 100. In VBScript you used to be able to do that by paging. Can you do something like that in PS 2.0 and return a subset of mailboxes, run a command and then get the next 100 and do the same working your way through the 45k mailboxes?


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>