Remote client exceeded allowed maximum

ipsec600
ipsec600 used Ask the Experts™
on
I am running the following PowerShell command to merge outlook safe sender list for all users.

Get-Mailbox -ResultSize Unlimited | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Add='corp@doamin1.com','admin@domain2.com'}

But receiving the following error:

Sending data to a remote command failed with the following error message: The total data received from the remote client exceeded allowed maximum. Allowed maximum is 524288000. For more information, see the about_Remote_Troubleshooting He
lp topic.
    + CategoryInfo          : OperationStopped: (System.Manageme...pressionSyncJob:PSInvokeExpressionSyncJob) [], PSRe
   motingTransportException
    + FullyQualifiedErrorId : JobFailure

Can you please advise.

Reference Link:
http://beccabits.com/2011/10/07/how-to-bulk-modify-safe-senders-list-in-outlook-with-exchange-management-shell/

On this note, if I run the above for few users then it is working perfectly. And while searching with the above error in the following link someone suggested the following:

"Powershell has a hard limit of 524288000.

The value for the powershell limit is in web.config file.

To increase the limit, increase the value and then recycle the app pool or iisreset"

http://social.technet.microsoft.com/Forums/en-US/8012950f-45dd-41f2-8a11-5c55b3ed8d36/allowed-maximum-is-524288000-when-running-a-powershell-script?forum=exchange2010

Not sure where I will be able to edit the web.conf file, if so, then what would be the impact and how to edit that file,

Need advise is there any way to  execute the command without error.

Get-Mailbox -ResultSize Unlimited | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Add='corp@doamin1.com','admin@domain2.com'}

Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Use a different profile when connecting to that server

Register-PSSessionConfiguration -Name BigData

Set-PSSessionConfiguration -Name BigData -MaximumReceivedDataSizePerCommandMB 1024 -MaximumReceivedObjectSizeMB 1024

New-PSSession -ComputerName EXCHANGESERVER -ConfigurationName BigData

Open in new window

Author

Commented:
Hi Scobber, thanks for your excellent reply, While I am running the command, in the last command receiving error,

can you please advise.

[PS] C:\>Register-PSSessionConfiguration -Name BigData

Confirm
Are you sure you want to perform this action?
Performing operation "Register-PSSessionConfiguration" on Target "Name: BigData. This will allow administrators to
remotely run Windows PowerShell commands on this computer".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y


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

Name                      Type                 Keys
----                      ----                 ----
BigData                   Container            {Name=BigData}

Confirm
Are you sure you want to perform this action?
Performing operation ""Restart-Service"" on Target "Name: WinRM".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y


[PS] C:\>Set-PSSessionConfiguration -Name BigData -MaximumReceivedDataSizePerCommandMB 1024 -MaximumReceivedObjectSizeMB
 1024

Confirm
Are you sure you want to perform this action?
Performing operation "Set-PSSessionConfiguration" on Target "Name: BigData".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin\BigData\InitializationParameters

ParamName            ParamValue
---------            ----------
psmaximumreceived... 1024
psmaximumreceived... 1024

Confirm
Are you sure you want to perform this action?
Performing operation ""Restart-Service"" on Target "Name: WinRM".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y


[PS] C:\>New-PSSession -ComputerName blexch01 -ConfigurationName BigData

[blexch01] Connecting to remote server failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM.
 If the destination is the WinRM service, run the following command on the destination to analyze and configure the Win
RM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Can you please advise.

Commented:
Create BigData profile on remote machine aswell

you should then see
S C:\Windows\system32> New-PSSession -Computername PEP-HV -ConfigurationName BigData

 Id Name            ComputerName    State         ConfigurationName     Availability
 -- ----            ------------    -----         -----------------     ------------
  4 Session4        PEP-HV          Opened        BigData                  Available

use enter-pssession id to enter the session
Most Valuable Expert 2014
Commented:
Why don't you just use a transport rule to configure an SCL value of -1 for those senders. No need to fiddle about with the safe senders list for all mailboxes.

Simon.

Author

Commented:
Thanks Simon, the I tried with that but still notice that emails those are external addresses are still going to outlook junk email folder, it surely works for internal domain address, but for some external addresses it is going to outlook junk email folder for that intend to merge outlook safe sender list to attend the issue.

Thanks Scobber, in the last command the error that I was receiving, after running winrm quickconfig command followed the parameter then  I saw the mentioned output you provided. But I tried to get the session and while running the PS command still receiving the same error, the PSsession  big data most-likely updating for Power Shell not Exchange Management Shell and hence I was encountering the same error.

To attend the issue I run the same Power Shell command across each exchange database and it resolved the issue. and also tried to run for distribution group limiting members it also works.

Thank you once again Simon and Scobber for providing me insight to resolve the issue.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial