Number of New Emails in Sent Items within 24 hours

Hi,

I am trying to create a simple script that will show me how many new email messages have been added to the Sent Items folder.  I am new to powershell so I ave basically put together a script from browsing the web, however its not working as expected.

Here is the script  I have so far

Get-MailboxFolderStatistics info -folderscope SentItems (Get-Date).AddDays(-1).ToString("ddMMyyy") | select name,itemsinfolder

I know this does not work but was wondering if anyone is able to add/subtract what I have done wrong.

or point me to a website that has a decent script

many thanks

May 28th, 2015 5:59pm

Unfortunately I don't have access to exchange to test or do any modification but hopefully below will help you with searching for sent-items (if it works on Exchange 2013) you can modify the select command to only show the SentItems, and then it's just a case playing with the Date, or you may be able to select the date, i can't pipe anything to Get-Member to find out :)

http://oxfordsbsguy.com/2014/04/14/exchange-powershell-how-to-check-the-number-of-items-in-the-inbox-sent-items-deleted-items-junk-email/

Hope this helps



Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 6:24pm

thank you, I will try this tomorrow
May 28th, 2015 6:53pm

The above given reference looks good to resolve your concern and find out the reports of all folders into exchange server.

By the way, for more depth reporting you can also look into this automated solution (http://www.mailboxfolder.exchangereports.net/) that provides entire mailbox folder reports at granular level and helps to track oversized, inactive or hidden mailboxes with more than fifty reports.

Free Windows Admin Tool Kit Click here and download it now
May 29th, 2015 3:32am

Hi,

Get-MailboxFolderStatistics can just retrieve information about the folders right now, it wont retrieve the information before.

To get the Number of E-mails Sent by one User within 24 hours, we can use MessageTrackingLog. Try this script:

[Int] $intSent = $intRec = 0

$date= (Get-Date).AddDays(-1)

Get-TransportService | Get-MessageTrackingLog -ResultSize Unlimited -Start $date -Sender "user@domain.com" -EventID RECEIVE | ? {$_.Source -eq "STOREDRIVER"} | ForEach { $intSent++ }

Write-Host "E-mails sent:    ", $intSent

I test in my lab, it work well.

Best Regards.

May 29th, 2015 3:42am

thanks for the above, i forgot to mention I am using Exchange 2010
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2015 9:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics