AdityaMukund The_Exchange_Team : I do realize PSSessions are being replaced by REST, just trying to find a working alternative to Invoke-Command with REST, especially since in our use case, we use Invoke-Command -AsJob to start a job, then process the job results as they come in (i.e. send them back to our calling application in pages), instead of having to cache >75k objects in memory first, then start processing.
Currently, it even looks like our use case isn't even possible with the EXOv3 module (without using RPS), since attempting to retrieve more than 1000 objects results in an error 'Expired or Invalid pagination request. Default Expiry time is 00:30:00'.
Although this message is about expiry, it actually takes 'only' 15 seconds, but retrieves exactly 1000 objects.
So it looks like the REST interface supports pagination (yay!), yet the module doesn't implement it (boo!)... except for the -PageSize parameter of Connect-ExchangeOnline, which seems to be completely ignored in this case.
Only option I see at present is using Get-EXORecipient (with RecipientType and a minimal propertyset) to retrieve all objects of a certain type (which does seem to work with pagination), then for each returned recipient use the Get-<recipienttype> command to retrieve the remaining properties). Which unfortunately comes with a huge performance impact.
Maybe it's an option to finally disclose the adminapi REST interface, eliminating the need of going through the PowerShell module for heavier workloads?