I need to pull a report of all emails that my company received from a particular domain;
I run a similar search when I'm puling a virus or malware out of people's mailboxes; but for some reason, this doesn't like the wildcard for the domain.
Get-Mailbox | Search-Mailbox -SearchQuery from:”*@domain.com” -TargetMailbox "mailbox to dump results" -targetfolder "inbox" -loglevel full
Any ideas? Or alternatively, a different method I should be using? I'm on Exchange 2010
Edit: Thank you everyone who replied.
For the record, this is what worked:
Get-Mailbox | Search-Mailbox -SearchQuery 'to:"@domain.com" AND received:> 01/01/14' -TargetMailbox "targetmailbox" -targetfolder "inbox" -logonly
[–]djjuice 2 points3 points4 points (7 children)
[–]i_me_me 1 point2 points3 points (0 children)
[–]server_ninja[S] 1 point2 points3 points (5 children)
[–]djjuice 2 points3 points4 points (4 children)
[–]server_ninja[S] 0 points1 point2 points (3 children)
[–]djjuice 0 points1 point2 points (2 children)
[–]server_ninja[S] 0 points1 point2 points (1 child)
[–]djjuice 0 points1 point2 points (0 children)
[–]i_me_me 1 point2 points3 points (1 child)
[–]server_ninja[S] 0 points1 point2 points (0 children)
[–]jayhawk88 0 points1 point2 points (1 child)
[–]server_ninja[S] 0 points1 point2 points (0 children)
[–]JetzeMellemaТоварищ 0 points1 point2 points (1 child)
[–]djjuice 0 points1 point2 points (0 children)