Messaging Tracking

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
LVL 5
Addy NadiaExpertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
SubsunCommented:
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
 
Addy NadiaExpertAuthor Commented:
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
 
Addy NadiaExpertAuthor Commented:
i am using exchange 2013, i think there command can be use Get-TransportService
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
SubsunCommented:
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
 
SubsunCommented:
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
 
Addy NadiaExpertAuthor Commented:
So i need to run simply this script whithout any change?

once i run it, it will ask for Recipient,end start date?
0
 
SubsunCommented:
You need to save it in to .ps1 file and run it from EMS.
0
 
SubsunCommented:
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
 
Addy NadiaExpertAuthor Commented:
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
 
SubsunCommented:
Try updated code which I posted for exchange 2013..
1
 
Addy NadiaExpertAuthor Commented:
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
 
SubsunCommented:
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

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
Addy NadiaExpertAuthor Commented:
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
 
SubsunCommented:
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
 
Addy NadiaExpertAuthor Commented:
Thank you Very Much
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.

All Courses

From novice to tech pro — start learning today.