How to fix Pagination Issue (Expired or Invalid Pagination Request) in Exchange Online PowerShell Commands

Adarsha Balila 20 Reputation points
2023-11-03T05:22:19.8333333+00:00

I am facing pagination issue while using the Exchange Online PowerShell cmdlets 'Get-Mailbox -ResultSize Unlimited' and 'Get-MailboxAuditBypassAssociation -ResultSize Unlimited'.

When I attempt to run these commands with the '-ResultSize Unlimited' parameter, I encounter an error message indicating "Expired or Invalid pagination request." This issue prevents me from retrieving all the necessary data, which is crucial for our operations.

Could you please provide guidance on how to resolve this issue? Is there a workaround or an alternative method to retrieve the complete set of data without encountering this pagination problem?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,186 questions
{count} votes

Accepted answer
  1. Anonymous
    2023-11-03T08:26:41.5966667+00:00

    Hello @Adarsha Balila

    This seems to be expected behavior, related to the "-pagesize" parameter, page cannot display more than 1000 results, and the default value is 1000."

    How about : Get-Mailbox -ResultSize 1000 OR :Get-exomailbox -resultsize unlimited

    User's image

    https://learn.microsoft.com/en-us/answers/questions/1023619/connect-exchangeonline-write-errormessage-expired

    Just a guess:

    If the page cannot display more than 1,000 results, is it possible to bypass on-screen display by exporting to CSV?

    Regards

    Shaofan


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.