In order for query to work, spaces should be avoided as they are treated as free text. I see you have space between received and the value. And :> is not a valid operator. Please refer to this page:
Also boolean operators should be written uppercase.
I have confirmed I am a member of Organization Management, Import export, and Mailbox Import Export, and that Administrator is as well.
I am also a member of Compliance Management, Delegated setup, Delivery Management, Help Desk, Public Folder Management, Recipient Management, Records Management, Server Management, and View-Only Organization Management.
You can try using the range operator in your dates “…”
Just make the starting date is something really old that you know will encompass everything:
We’ll also use -EstimateResultsOnly to preview if it is working and returning messages. You can change to delete after you can prove that you’re getting a message count
postanote,
I changed it to match my environment, and success is still false.
I copied the script to one of the exchange servers, logged in as Domain Admin to the exchange server, and ran it, same results.
I Like Cheese
I still get success of False, even logged directly into the exchange server as Domain Admin
RunspaceId : GUID
Identity : contoso.com/username
TargetMailbox :
Success : False
TargetFolder :
ResultItemsCount : 0
ResultItemsSize : 0 B (0 bytes)