Solved

Exchange Powershell help

Posted on 2016-11-11
6
48 Views
Last Modified: 2016-11-13
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
Comment
Question by:crp0499
  • 2
  • 2
  • 2
6 Comments
 
LVL 69

Accepted Solution

by:
Qlemo earned 250 total points
ID: 41884588
Something like
Get-MessageTrackingLog -EventID Transfer | ft -a Sender, Recipients, MessageSubject, Timestamp

Open in new window

does not work for you?
0
 

Author Comment

by:crp0499
ID: 41885015
And how can I pipe that to a CSV please sir?
0
 
LVL 14

Assisted Solution

by:Schnell Solutions
Schnell Solutions earned 250 total points
ID: 41885019
Get-MessageTrackingLog -EventID Transfer | Select  Sender, Recipients, MessageSubject,Timestamp | export-csv -path c:\folder1\file1.csv
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:crp0499
ID: 41885022
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
 
LVL 14

Expert Comment

by:Schnell Solutions
ID: 41885030
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
 
LVL 69

Expert Comment

by:Qlemo
ID: 41885242
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

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article explains how to install and use the NTBackup utility that comes with Windows Server.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question