Hi,
I am trying to copy all emails in Exchange from a specific a sender's domain to .PST then delete them all.
So far I am only able to copy into a folder and delete by sender's email address and not the sender's domain.
This is what I am using.
get-mailbox | Search-Mailbox -SearchQuery From:name@domain.com -TargetMailbox helpdesk -TargetFolder Export -LogLevel Full DeleteContent
How do I get to it become *:*@domain.com where it picks all of the domain and not just the single sender?
Or what is a better way of accomplishing this?