Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get mailbox itemcount for items with specific received date

Status
Not open for further replies.

kokser

Programmer
Sep 25, 2009
90
DK
I have created a small script that can retrieve the itemcount for a mailbox.
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$filecsv = "Mail_Export.csv"
$date = get-date -uformat %d/%m/%Y

$output = get-mailbox | get-mailboxstatistics | where {$_.ObjectClass –eq “Mailbox”} && where {mails with received date are equal to $date} | select $_.ItemCount
$output | export-csv -path $filecsv -encoding utf8 -notypeinformation
Is it possible to do the 2nd Where? The output should only be the number of mails received on a given date.
 
Right off hand I don't see that you can dig that deeply. The cmdlet Get-MailboxFolderStatistics will get you folder names and the counts within the folders:
Code:
Get-MailboxFolderStatistics -identity mailboxalias | Select Identity, ItemsInFolder
But it doesn't appear to let you step through the individual messages. Still looking
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top