You need the mailbox search role. Or add yourself to the Discovery Management Role
https://learn.microsoft.com/en-us/exchange/discovery-management-exchange-2013-help
Unable to run command in Exchange Powershell

Hello
I am trying to run a search on all Exchange mailboxes for some specific text. The following article suggests that this is possible. Is that correct? (Exchange 2019)
As directed by the article, I tried to run the command in step 1
New-ComplianceSearch -Name "Search All-Financial Report" -ExchangeLocation all -ContentMatchQuery 'sent>=01/01/2015 AND sent<=06/30/2015 AND subject:"financial report"'
That command fails, - error says that "The term 'New-ComplianceSearch' is not recognized as the name of a cmdlet..."
Can someone tell me why this command doesn't work?
There's nothing about it in this article, but another one told me that I have to be a member of Compliance Management, Organization Management and Records Managment role groups. Confirmed that I am a member of all three of those.
Thank you for any help you can give me.
-
Andy David - MVP 115.3K Reputation points MVP
2022-08-31T12:01:38.883+00:00 1 additional answer
Sort by: Most helpful
-
Denis Repp 81 Reputation points
2022-08-31T13:14:04.027+00:00 Thank you for the help, but that did not work. I added myself to that group in the EAC, waited a bit, and confirmed in Powershell that I am now a member.
I ran the same command again, and got the same error again.What next?
Thank you
-