How to get message tracking for all the users
Hi
I want to know how can i track how many emails been sent and received from a date to particular date. ( for example 1 week). i know the below command will give output of one user but how can i get all the users information
[PS] C:\Documents and Settings\administrator\Desktop>Get-MessageTrackingLog -Server exchange05 -EventID send -Sender user1@domain.com -Start 03/02/2010 -End 03/10/2010 |measure-object
Any help would appreciate.
April 3rd, 2010 10:42am
Hi,
You may pass the user one by one like this if your sender are the mailboxes existed in your exchange environment:
get-mailbox -resultSize unlimited | Foreach {
Get-MessageTrackingLog -Server exchange05 -EventID send -Sender $_.PrimarySmtpAddress -Start 03/02/2010 -End 03/10/2010 |measure-object}
You may also pass the user one by one like this:
Create a csv file for your senders like this
Sender
user1@domain1.com
user2@domain2.com
user3@domain3.com
and save it as "C:\\YourSenders.csv"
and now use
import-csv "C:\\YourSenders.csv" | Foreach {
Get-MessageTrackingLog -Server exchange05 -EventID send -Sender $_.Sender -Start 03/02/2010 -End 03/10/2010 |measure-object}
I have just given idea and have not tested the above script lines.
Regards,
Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM)
www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2010 1:11pm
Hi
It's only giving total count and there is no user information
April 4th, 2010 1:44pm
Hi
It's only giving total count and there is no user information
Plz tell us what script have u used and what error or result u get.
Regards,Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM)
www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
April 4th, 2010 3:08pm
This is "air code", but I think it may be at least close to what you're after:
$sent = @{}$recv = @{}
get-messagetrackinglogs -start <start date> -end <end date> -resultsize unlimited |%{
if ($_.eventid -eq "SEND"){$sent[$_.sender] += 1}
if ($_.eventid -eq "DELIVER"){ foreach ($recp in $_.recipients){$recv[$recp] += 1}}
$stats = @()
$addrs = ($sent.keys + $recv.keys) | sort -unique
foreach ($addr in $addrs){ $stat = "" | select Name,Sent,Received $stat.name = (get-mailbox $addr).displayname if ($recv[$addr]){$stat.received = $recv[$addr]} if ($sent[$addr]){$stat.sent = $sent[$addr].displayname} $stats += $stat}
$stats | export-csv mailstats.csv -notype
April 4th, 2010 4:05pm
Hi,
In addition to Power shell, you can also use Log Parser as Exchange team log said.
http://msexchangeteam.com/archive/2007/11/12/447515.aspx
http://msexchangeteam.com/archive/2007/11/28/447598.aspx
http://msexchangeteam.com/archive/2008/02/07/448082.aspx
Frank Wang
Free Windows Admin Tool Kit Click here and download it now
April 6th, 2010 11:26am