Solved

Messaging Tracking

Posted on 2016-10-20
15
16 Views
Last Modified: 2016-10-21
Hello Team,

Could you suggest, using the below paramater, how can i try to message track for selected recipient from all transport server.
currently i need to mention particular Transport server in command to get the details

example command

Get-MessageTrackingLog -server xyz306 -recipients "Eric.Chu@xxx.com" -Start "10/19/2016 7:00AM" -End "10/19/2016 18:00PM" | select Sender,messagesubject,timestamp,eventid | out-string -width 300 | out-file c:\msgtrck1.csv

Thanks,

we have 8 exchange server in environment exchange 2013
0
Comment
Question by:Andy Navi
  • 8
  • 7
15 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 41851839
Try..
$server = Get-TransportServer | Select -exp name
$server |%{Get-MessageTrackingLog -server $_ -recipients "Eric.Chu@xxx.com" -Start "10/19/2016 7:00AM" -End "10/19/2016 18:00PM" | select Sender,messagesubject,timestamp,eventid } | Export-csv c:\msgtrck1.csv -nti

Open in new window

1
 
LVL 4

Author Comment

by:Andy Navi
ID: 41851842
these both command need to run at same time ?

Is there any script like this in small.. when i enter, it will ask the recipient name to mention and date and time ?
0
 
LVL 4

Author Comment

by:Andy Navi
ID: 41851848
i am using exchange 2013, i think there command can be use Get-TransportService
0
 
LVL 40

Expert Comment

by:Subsun
ID: 41851866
Yes.. You can also try this single command, but some time I have see it's gives error in EMS..
Get-TransportServer |%{Get-MessageTrackingLog -server $_.Name -recipients "Eric.Chu@xxx.com" -Start "10/19/2016 7:00AM" -End "10/19/2016 18:00PM" | select Sender,messagesubject,timestamp,eventid } | Export-csv c:\msgtrck1.csv -nti

Open in new window

Is there any script like this in small.. when i enter, it will ask the recipient name to mention and date and time ?
Simple option is to use Read-Host command..
Example, save following code in a .ps1 file and run it from Exchange Management Shell
$recipients = Read-Host "Enter Recipients"
$End = Read-Host "Enter Start Date"
$Start = Read-Host "Enter End Date"
$server = Get-TransportServer | Select -exp name
$server |%{Get-MessageTrackingLog -server $_ -recipients $recipients  -Start $Start -End $End | select Sender,messagesubject,timestamp,eventid } | Export-csv c:\msgtrck1.csv -nti

Open in new window

1
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 500 total points
ID: 41851871
For Exchange 2013, try..
$recipients = Read-Host "Enter Recipients"
$End = Read-Host "Enter Start Date"
$Start = Read-Host "Enter End Date"
Get-ExchangeServer | ? {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-MessageTrackingLog -recipients $recipients  -Start $Start -End $End | select Sender,messagesubject,timestamp,eventid | Export-csv c:\msgtrck1.csv -nti

Open in new window

1
 
LVL 4

Author Comment

by:Andy Navi
ID: 41851872
So i need to run simply this script whithout any change?

once i run it, it will ask for Recipient,end start date?
0
 
LVL 40

Expert Comment

by:Subsun
ID: 41851877
You need to save it in to .ps1 file and run it from EMS.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 40

Expert Comment

by:Subsun
ID: 41851882
Use updated script, there is a correction in the start and end time variable..
$recipients = Read-Host "Enter Recipients"
$Start = Read-Host "Enter Start Date"
$End = Read-Host "Enter End Date"
Get-ExchangeServer | ? {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-MessageTrackingLog -recipients $recipients  -Start $Start -End $End | select Sender,messagesubject,timestamp,eventid | Export-csv c:\msgtrck1.csv -nti

Open in new window

1
 
LVL 4

Author Comment

by:Andy Navi
ID: 41851897
i am getting below error while running this script

WARNING:  The Get-TransportServer cmdlet will be removed in a future version of
 Exchange. Use the Get-TransportService cmdlet instead. If you have any scripts
 that use the Get-TransportServer cmdlet, update them to use the
Get-TransportService cmdlet.  For more information, see
http://go.microsoft.com/fwlink/p/?LinkId=254711.
The search time range was incorrectly specified. The End and Start parameter
values can't be the same.
    + CategoryInfo          : InvalidArgument: (:) [], LocalizedException
    + FullyQualifiedErrorId : [Server=CHLTE306,RequestId=d1153d11-b4a7-4884-a6
   16-26b3c3183d18,TimeStamp=10/20/2016 11:59:10 AM] [FailureCategory=Cmdlet-
  LocalizedException] 97A2DFBF
    + PSComputerName        : abc.domain.com


when it ask for details,
i am enetring start date in this format
10/18/2016 07:00:00 AM


Thanks,
0
 
LVL 40

Expert Comment

by:Subsun
ID: 41851905
Try updated code which I posted for exchange 2013..
1
 
LVL 4

Author Comment

by:Andy Navi
ID: 41851947
now i have run your updated script , i am geeting error


The input object cannot be bound to any parameters for the command either
because the command does not take pipeline input or the input and its
properties do not match any of the parameters that take pipeline input.
    + CategoryInfo          : InvalidArgument: (chlte306:PSObject) [Get-Messag
   eTrackingLog], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Get-MessageTrackingLog
    + PSComputerName        : exchangecasarray.abc.com
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41852014
Try changing the last line to..
Get-ExchangeServer | ? {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | %{Get-MessageTrackingLog -server $_.Name -recipients $recipients  -Start $Start -End $End | select Sender,messagesubject,timestamp,eventid} | Export-csv c:\msgtrck1.csv -nti

Open in new window

0
 
LVL 4

Author Comment

by:Andy Navi
ID: 41852629
Thanks, This works perfectly fine. to get more fine results

could you recommend with more filter added in (Sender,messagesubject,timestamp,eventid) to get more good results if i am tracking any email,
0
 
LVL 40

Expert Comment

by:Subsun
ID: 41852680
That really depend on what you are tracking. If you are tracking mail send by user you can add -EventId Send, or if you are looking for any failed events then -EventId "Fail", or if you know the subject the use -MessageSubject "Payroll email".. Etc..
Refer following article for more details..
https://technet.microsoft.com/en-us/library/aa997573(v=exchg.160).aspx
0
 
LVL 4

Author Closing Comment

by:Andy Navi
ID: 41854479
Thank you Very Much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
how to add IIS SMTP to handle application/Scanner relays into office 365.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now