• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 111
  • Last Modified:

Exchange Powershell help

We have an on prem exchange 2013 server and an O365 account for our Skype for Business.  Our mail flows in and out through O365.

I need a trace report showing ALL mail flowing out and who sent it.  The problem I have is that I have to pick a domain or a mailbox or something and I need ALL mail flowing to O365 from our on prem server.

The trace report isn't helping me so I'm thinking powershell.

Can anyone help with a powershell that will show me all mail flowing out from our on prem to our O365 connector and who the sender was?

Thanks

Cliff
0
crp0499
Asked:
crp0499
  • 2
  • 2
  • 2
2 Solutions
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Something like
Get-MessageTrackingLog -EventID Transfer | ft -a Sender, Recipients, MessageSubject, Timestamp

Open in new window

does not work for you?
0
 
crp0499CEOAuthor Commented:
And how can I pipe that to a CSV please sir?
0
 
Schnell SolutionsSystems Infrastructure EngineerCommented:
Get-MessageTrackingLog -EventID Transfer | Select  Sender, Recipients, MessageSubject,Timestamp | export-csv -path c:\folder1\file1.csv
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
crp0499CEOAuthor Commented:
When I add the export to csv, all I get is a column in excel with that looks like a GUID or something.  when i do not pipe to csv, it outputs correctly in the command window
0
 
Schnell SolutionsSystems Infrastructure EngineerCommented:
Ohs, that is for the 'Recipient' column right? because it is a multi string value that cannot be catch as the field of an csv file. There are other formats that can catch that column, but they are not for excel, one example is to export it as XML (which is quite different).

The rest of the values that are not multiples are suppose to display ok, and if you want to check all the possible fields that you have, you can execute:

Get-MessageTrackingLog -EventID Transfer | Select  * | export-csv -path c:\folder1\file1.csv
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You've closed the question prematurely.
For a CSV-suitable output use
Get-MessageTrackingLog -EventID Transfer |
  Select  Sender, @{n='Recipients'; e={$_.Recipients -join ';'}}, MessageSubject,Timestamp |
  export-csv -NoType c:\folder1\file1.csv

Open in new window

This creates a semicolon-separated recipients list as a single column, and also suppresses the first line with type info in the CSV which is of no use for you (It is for re-importing into PowerShell, using correct types instead of plain strings).

Another common way to handle such lists is by creating "duplicate" entries for each single recipient, but I guess that is unwanted here.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now