Link to home
Create AccountLog in
Exchange

Exchange

--

Questions

--

Followers

Top Experts

Avatar of cawasaki
cawasaki

script to count all email received for 50 mailbox on exchange 2013
hello,

i need a powershell script to get mailbox from csv file like this one:

mailbox1@domain.com
mailbox2@domain.com
mailbox3@domain.com
.....

and get for each one the number of email received last 3 month.

all my server are exchange 2013.

thanks

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of AmitAmit🇮🇳


Avatar of cawasakicawasaki

ASKER

hello Amit,

how i can apply this for 100 emails address?

Avatar of Will SzymkowskiWill Szymkowski🇨🇦

Use the following script below...
Make sure that your csv heading is Mailbox, then use the code below.
$Date = get-date
$Mailboxes = import-csv "c:\filename.csv"
ForEach ($User in $Mailboxes) {
$User.Mailbox
Get-MessageTrackingLog -Server <CASserver> -Start $Date.AddDays(-7) -Sender $User.Mailbox | measure
}

Open in new window


This will simply get the Count of all messages that were sent from each user that is in your csv file.

Will.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Hello

What i need is count email received on this mailbox not sent

Thanks

Avatar of Will SzymkowskiWill Szymkowski🇨🇦

Ahh sorry about that, been a long day. I have modified my original script to accommodate your requirements.

$Date = get-date
$Mailboxes = import-csv "c:\filename.csv"
ForEach ($User in $Mailboxes) {
$User.Mailbox
Get-MessageTrackingLog -Server <CASserver> -Start $Date.AddDays(-90) -Recipient $User.Mailbox | measure
}          

Open in new window


Just remember that if your message tracking logs are not set to 3 months back you will only be able to go back as far as what the transport settings are set to. By default it is 30 days.

Will.

hello,

i need to test this to be sure that the number of email i get from this script is the good number of only mail received and not sent & received.

it possible to get csv file result with mailbow and number like this:

test@domain.com,50
......

thanks

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of Will SzymkowskiWill Szymkowski🇨🇦

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

i have test the script with -Start $Date.AddDays(-1) to get all email received to day but the number is not good, i have received more 20 email and the script show 11
Exchange

Exchange

--

Questions

--

Followers

Top Experts

Exchange is the server side of a collaborative application product that is part of the Microsoft Server infrastructure. Exchange's major features include email, calendaring, contacts and tasks, support for mobile and web-based access to information, and support for data storage.