Environment:
Have Hybrid environment, with Exchange Server 2016 and Office 365.
ISSUE:
Want to Search a specific email in all users mailboxes with the following command:
[PS] C:\>Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"FW:SubjectOfEmail"' -TargetMailbox nawazABC -TargetFolder "inbox\spamitems"
But getting the following Error:
Sending data to a remote command failed with the following error message: [ClientAccessServer=SERVERNAME,BackEndSer
ver=SERVERNAME.Domain.com,RequestId=9c2cdfdse-4fd7-fds80-8df7-efdsfdsfa,TimeStamp=3/30/2021 7:32:30 AM]
[FailureCategory=WSMan-Others] The total data received from the remote client exceeded the allowed maximum. The
allowed maximum is 524288000. For more information, see the about_Remote_Troubleshooting Help topic.
REASON/Solution:
The Search-Mailbox have some limitations as per the given error that it can return limited number of results. So we have to run our command multiple times, may be for a group of mailboxes, mailbox databases or servers. like as below
1-
Search-Mailbox -identity mailbox1 -SearchQuery 'Subject:"FW:SubjectOfEmail"' -TargetMailbox nawazABC -TargetFolder "inbox\spamitems"
2 -
Get-Mailbox -database DB1 | Search-Mailbox -SearchQuery 'Subject:"FW:SubjectOfEmail"' -TargetMailbox nawazABC -TargetFolder "inbox\spamitems"
3-
Get-Mailbox -Server Server1 | Search-Mailbox -SearchQuery 'Subject:"FW:SubjectOfEmail"' -TargetMailbox nawazABC -TargetFolder "inbox\spamitems"
No comments:
Post a Comment