Solved

Outlook 2010 Daily inbound email

Posted on 2016-10-14
2
34 Views
Last Modified: 2016-10-17
Is there a way to know the number of inbound email over one mailbox?
0
Comment
Question by:Hiroyuki Tamura
2 Comments
 
LVL 15

Accepted Solution

by:
cwstad2 earned 500 total points
ID: 41843770
Hi are you using exchange 201*

If so you can try the following script, but you will need to modify so that its for one day

####################################
# Exchange 2010 send/receive weekly report generator
# Created by: Eric Schewe
# Created on: 2014-10-02
#
####################################
# Summary:
#   This script will count the unique message IDs send and recieved by a mailbox
#   on a weekly basis and e-mail a report to the designated recipients. We are
#   specifically using this script to track mailflow to and from a generic account
#   in our enviroment.
#
#   This script is meant to be run on a Monday so it can gather the previous weeks
#   e-mails (Monday - Sunday).
#
####################################
# Instructions:
#   1. Set $mailbox to the generic account you want stats from
#   2. Set $emailFrom to the e-mail address that the report will be sent from
#   3. Set $emailTo to the people who will receive the report
#   4. Set $smtpServer to a SMTP server you can send e-mail from
#   
####################################
 
#Powershell Garbage
$nl = [Environment]::NewLine
 
#Mailbox to gather stats on
$mailbox=""
 
#Get todays date twice
$startDate=Get-Date
$endDate=Get-Date
 
#Subtract 1 day from todays date (report ending day) and 7 days from todays date (report starting day)
$startDateFormatted=$startDate.AddDays(-7).ToShortDateString()
$endDateFormatted=$endDate.AddDays(-1).ToShortDateString()
 
 
#Who to send the e-mail report to.
#Multiple e-mail addresses should be in this format "<email1@somewhere.com>, <email2@somewhere.com>"
$emailFrom = "no-reply@mydomain.com"
$emailTo = ""
$subject = "Weekly e-mail report for $mailbox for $startDateFormatted - $endDateFormatted"
$smtpServer = ""
 
 
# Sent e-mails
$sendCount = Get-TransportServer | Get-MessageTrackingLog -Start "$startDateFormatted 00:00:00" -End "$endDateFormatted 23:59:59" -Sender $mailbox -resultsize unlimited | select-object -unique MessageId
 
# Received e-mails - This works but not on generic accounts
$receiveCount = Get-TransportServer | Get-MessageTrackingLog -Start "$startDateFormatted 00:00:00" -End "$endDateFormatted 23:59:59" -Recipients $mailbox -resultsize unlimited | select-object -unique MessageId
 
$sendCountString = $sendCount.count
$receiveCountString = $receiveCount.count
 
$body = "Mailbox stats for: $mailbox $nl
Report date range: $startDateFormatted 00:00:00 - $endDateFormatted 23:59:59 $nl
Total e-mails sent: $sendCountString $nl
Total e-mails received: $receiveCountString"
 
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($emailFrom, $emailTo, $subject, $body)

I have a scheduled task configured on one of our Exchange servers that runs this every Monday morning and provide me the stats on a generic mailbox for the previous week (Monday – Sunday).

Open in new window

0
 

Author Closing Comment

by:Hiroyuki Tamura
ID: 41847041
Thank you,.
0

Featured Post

Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Find out what you should include to make the best professional email signature for your organization.
To show how to generate a certificate request 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 Servers >> Certificates…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

919 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

17 Experts available now in Live!

Get 1:1 Help Now