Link to home
Start Free TrialLog in
Avatar of Christian Hans
Christian HansFlag for United States of America

asked on

Export list of all external senders (Exch2013/ExchOL)

Is there a way in PowerShell to export a list of all external email addresses that have sent to my company's users, say over the past month, in Exchange 2013 or Exchange Online?
Avatar of Andy M
Andy M
Flag of United Kingdom of Great Britain and Northern Ireland image

You could do this using the Message Tracking Log  in Exchange management Shell providing your logs go back far enough:

-getmessagetrackinglog -resultsize unlimited -start "12/01/2017 00:00" -End "01/01/2018 23:59" -EventID "Deliver" | select Sender, Recipients

You will want to output it to a text file or csv.
Avatar of Christian Hans

ASKER

Thanks Andy, that will work on my Exchange 2013 servers, any ideas about Exchange Online? I realize that I'm limited to 30 days only.

Get-MessageTrace -Resultsize Unlimited -StartDate 12/5/2017 -EndDate 1/4/2018 | Select Received,SenderAddress,RecipientAddress,Subject | Export-CSV C:\MessageTrace_Results.csv -NoTypeInformation

-Resultsize Unlimited parameter wont work, and without it, it seems like the output is limiting the results to 1000.
SOLUTION
Avatar of Andy M
Andy M
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yep, one would think that I could get more than 1000, but even the 5000 parameter wont work unfortunately.

$dateEnd = Get-Date
$dateStart = $dateEnd.AddDays(-30)
Get-MessageTrace -Resultsize 5000 -StartDate $dateStart -EndDate $dateEnd | Select-Object Received,SenderAddress,RecipientAddress,Subject | Export-CSV C:\MessageTrace_Results.csv -NoTypeInformation


A parameter cannot be found that matches parameter name 'Resultsize'.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Split:
-- Naveen Sharma (https:#a42424697)
-- Andy M (https:#a42423697)


If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Pber
Experts-Exchange Cleanup Volunteer