Solved

Messaging Tracking

Posted on 2016-10-20
15
41 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:Addy Nadia
  • 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 5

Author Comment

by:Addy Nadia
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 5

Author Comment

by:Addy Nadia
ID: 41851848
i am using exchange 2013, i think there command can be use Get-TransportService
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 5

Author Comment

by:Addy Nadia
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
 
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 5

Author Comment

by:Addy Nadia
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 5

Author Comment

by:Addy Nadia
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 5

Author Comment

by:Addy Nadia
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 5

Author Closing Comment

by:Addy Nadia
ID: 41854479
Thank you Very Much
0

Featured Post

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.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
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…

860 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