Avatar of ipsec600
ipsec600
 asked on

Remote client exceeded allowed maximum

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,
ExchangePowershellScripting Languages

Avatar of undefined
Last Comment
ipsec600

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scobber

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ipsec600

ASKER
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.
Scobber

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
SOLUTION
Simon Butler (Sembee)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ipsec600

ASKER
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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23