#Get all transport servers so we can search across all of them
$hubs=get-TransportServer
#where test.txt contains a list of email addresses
$groups=get-content "C:\MessageTrackingRobin\test.txt"
#For each email address in test.txt, count how many messages were sent to it between the start and end dates, then output that information into count.txt in comma delimited format
foreach ($group in $groups){
$count = ($hubs| get-messagetrackinglog -start "09/19/2011 12:00AM" -End "10/20/2011 11:59PM" -recipients $group)
$output=$group + "," + $count.count
add-content count.txt $output
}
No comments:
Post a Comment