The total data received from the remote client exceeded the allowed maximum

By | 7th May 2017

When you have a large environment and you are running a command such as Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | select .... you might have seen this error:

 

There are a couple of solutions or workarounds.

  • One solution could be to split the command and run it against each database instead and then combine the result.
  • Another option is to use a ForEach loop instead of piping the command, this seems to work in most cases as well.
  • Or create a new- PSSessionConfiguration on your remote server

Open a PowerShell window as Administrator

 

Then you need to configure the values: MaximumReceivedDataSizePerCommandMB and MaximumReceivedObjectSizeMB

 

Then create a new session with the custom PSSessionConfiguration:

 

Make sure that you create the Custom PSSessionConfiguration on the server you are connecting to otherwise you’ll get an error saying something like

 

 




I hope this was informative. For questions or comments you can always give a reaction in the comment section or contact me:

One thought on “The total data received from the remote client exceeded the allowed maximum

  1. William W

    I ran into this exact issue setting Exchange public folder permissions. Instead of piping
    get-publicfolder …. -recurse | Add-PublicFolderClientPermission

    This worked for me:
    get-publicfolder …. -recurse | foreach {….}

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.