Odd PS behavior on new console server(s)

I’ve using a query like this to search a mailbox for malicious emails that we get notified about… and it’s worked for years on the older servers.

Get-mailbox Recipientaddress | search-mailbox –searchquery { from:sender address} –targetmailbox MSGSearchMBXTest –TargetFolder 1-TRG-Remove_onSndr –loglevel full

Running it on newservers from an admin level EPS session it fails, as below

Warning: The search-Mailbix cmdlet returns up to 10000 results per MB if search query is specfied. To return more than 10000 results, use New-MailboxSearch cmdlet or the In-place eDiscovery & hold console in Exchange Admin Center

The input cannot be bound to any parameters for the command either because the command does not take pipeline input or the input properties do not match any of the parameters that take pipeline input

  • CategoryInfo : invalidArgument: (MSGSearchMBXTest) [Search-Mailbox]

Hi asif-india and welcome back to the forums.

Can you do a Get-Help Get-MailBox and Get-Help New-MailboxSearch? This will show what inputs and parameters are allowed on the cmdlets.

The public view will not know what these cmdlets do or how they operate so we need context of what they do.

Hey @asif-india, the warning it gives indicates that there are more than 10,000 results to be displayed. I would either do more filtering (remember to filter as far left as possible) or sue the New-MailBoxSearch cmdlet