question

MichaelEriksson-2831 avatar image
0 Votes"
MichaelEriksson-2831 asked StephanW-7544 commented

The WinRM client sent a request to the remote WS-Management service and was notified that the request size exceeded the configured MaxEnvelopeSize quota.

In our new Exchange 2019 CU8 environment I very often get the error "The WinRM client sent a request to the remote WS-Management service and was notified that the request size exceeded the configured MaxEnvelopeSize quota." when I try to run a command.

We have just started migrating from 2013 ant this morning after I had migrated the first 200 mailboxes I thought I remove all move requests, so I ran Get-MoveRequest -MoveStatus completed | Remove-MoveRequest and got the error.

I checked the configured size and it looked good I think

[PS] C:\windows\system32>Get-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb


WSManConfig: Microsoft.WSMan.Management\WSMan::localhost

Type Name SourceOfValue Value


System.String MaxEnvelopeSizekb 4096

I think 4096 should be plenty for such a command.

Anyone experienced this? I know I can increase the value, but should it really be needed? If so is there a max supported size?

Regards

Michael

office-exchange-server-administrationoffice-exchange-server-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YukiSun-MSFT avatar image
0 Votes"
YukiSun-MSFT answered YukiSun-MSFT edited

Hi @MichaelEriksson-2831,

I did much research regarding "MaxEnvelopeSizeKb" but didn't see any statement about its maximum supported size. However, as regards to the error message you encountered above, to the best of my knowledge, in most cases it can be resolved by increasing the value of MaxEnvelopeSizeKb. I've seen in several links that the value was raised to 8000 or higher, so agree with Andy that it's suggested to have a go by setting it to a larger value like 8192 and check the result.

Here are some relevant links for your reference:
winrm set winrm/config @{MaxEnvelopeSizekb="8192"} :: Error - The IP Filter is invalid
Exchange 2013 in EMC you get he WinRM client sent a request to the remote WS-Management service and was notified that the request size exceeded the configured MaxEnvelopeSize quota.
Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.



Update:

To modify the maxEnvelopeSize value via registry subkeys please refer to the steps below:

Important: Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.

  1. Launch Registry Editor(regedit.exe) on the Exchange server, access to the path below:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Client

  2. Double click "maxEnvelopeSize" in the right pane, choose "Decimal", change the value to "8192":
    83776-registry.jpg

  3. Run the command below to check the result:

    Get-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb

83770-result.jpg



If an Answer is helpful, please click "Accept Answer" and upvote it.
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.



registry.jpg (77.8 KiB)
result.jpg (20.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndyDavid avatar image
0 Votes"
AndyDavid answered AndyDavid edited

I'd set to 8192 and see how that looks.
I have had to this in the past - similar to:

http://chrisreinking.com/fixing-exchange-2010-winrm-maxenvelopesize-exceeded-error/

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelEriksson-2831 avatar image
0 Votes"
MichaelEriksson-2831 answered StephanW-7544 commented

Hi,

Thank you both for your answers. I went ahead and tried to update the setting to 8192, but got an error I can't get my head around.

Set-Item : The system cannot find the file specified.

When trying to run Set-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb -Value 8192

If I do a get-item -path WSMAN:\localhost* everything looks ok

WSManConfig: Microsoft.WSMan.Management\WSMan::localhost

Type Name SourceOfValue Value


System.String MaxEnvelopeSizekb 4096
System.String MaxTimeoutms 60000
System.String MaxBatchItems 32000
System.String MaxProviderRequests 4294967295
Container Client
Container Service
Container Shell
Container Listener
Container Plugin
Container ClientCertificate

I feel rather stupid right now...... Any ideas on that to?

Regards

Michael

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MichaelEriksson-2831,

Please open EMS as an Administration and run the command again to check how it goes:

 Set-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb -Value 8192

Or you can run the following command in an elevated Command Prompt:

 winrm set winrm/config @{MaxEnvelopeSizekb="8192"}

82721-1.jpg

I've just tested in my lab and both the above worked at my end.


If an Answer is helpful, please click "Accept Answer" and upvote it.
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 Votes 0 ·
1.jpg (25.3 KiB)

Hi, thank you for your answer,

Unfortunately the same result, just a bit different text. This is starting to drive me insane.....

Ragards

Michael

The winrm way

C:\windows\system32>winrm set winrm/config @{MaxEnvelopeSizekb="8192" }
WSManFault
Message
ProviderFault
WSManFault
Message = The system cannot find the file specified.

Error number: -2147024894 0x80070002
The system cannot find the file specified.

Set-Item way

PS C:\windows\system32> Set-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb -Value 8192
Set-Item : The system cannot find the file specified.
At line:1 char:1
+ Set-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb -Value 8192
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-Item], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.SetItemCommand

0 Votes 0 ·

Hi @MichaelEriksson-2831,

Based on my research, the error "The system cannot find the file specified" may indicate a permission problem. But from the information you shared, seems you are already running the command as an administrator, right?

Given this, please try modifying hte registry and see if it works. Due to the 1000 characters limit of a comment, I'll edit my Answser earlier to include the steps about modifying the registry, please see the "Update" section.


0 Votes 0 ·
StephanW-7544 avatar image StephanW-7544 MichaelEriksson-2831 ·

Hi!
I have the same issue on a Cluster Server 2022. Do you have a solution by now?

0 Votes 0 ·