Deleting emails by user's domain in Exchange

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?

August 31st, 2015 2:54pm

Hello

only "from:domain.com" not help?

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 3:37pm

yes, that is what I was missing.  I been trying to use "From:@domain.com"

Thanks!

August 31st, 2015 6:14pm

Drop the @ i.e. use "from:domain.com"
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 9:48pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics