#Exchange 2010 Oldest Email

#Exchange2010 #Powershell

How kewl is this.  So I wanted to know the oldest email on Exchange 2010, so I ran this:

Get-mailboxdatabase | Get-mailbox | Sort Name | ForEach{$s=$_.SamAccountName;Get-MailboxFolderStatistics $s -IncludeOldestAndNewestItems | sort OldestItemReceivedDate | where {$_.OldestItemReceivedDate -ne $null} | select Identity,OldestItemReceivedDate -First 1}

And the winner was 1997!

Comments

  1. Martin P says:

    Appears to have worked on Exchange 2007 as well, although it’s showing Contacts and Calendar Items, too.
    Thanks!

  2. This is just awesome :-)

  3. WilWissing says:

    Perfect! Just what I was looking for. Six years later, and still relevant. Thank you.

Leave a Reply

%d bloggers like this: