Solved

Exchange 2010 SP3 - Export all mail from date and going forward

Posted on 2014-12-13
5
77 Views
Last Modified: 2015-03-01
Hi EE,

I'm using:

  $a=Get-Mailbox -Identity "*"
 
  PS C:\Windows\system32> $a |%{
>> $pst=$_.alias+".pst"
>> New-MailboxImportRequest -Mailbox $_.alias -FilePath "\\10.97.113.117\smartware\ExchExport\CurrentEmp\$pst"  -BadItemLimit 100 –AcceptLargeDataLoss –AssociatedMessagesCopyOption copy
>> }

No what would I use to export all mail after 11/30/2014?

Tight deadline by manager.  Any info is much appreciated.
0
Comment
Question by:MacGyver80
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:Ivan
Comment Utility
Hi there,

try something like this, for a single user.

New-MailboxExportRequest -Mailbox "user"  -ContentFilter {(Received -gt 11/30/2014)}  -FilePath "\\10.97.113.117\smartware\ExchExport\CurrentEmp\user.pst"

I don't have exchange to try, but I think it should work.

Regards,
0
 
LVL 18

Expert Comment

by:irweazelwallis
Comment Utility
New-MailboxExportRequest -ContentFilter {(Received -lt '04/01/2010') -and (Received -gt '03/01/2010')} -Mailbox "xx" -Name xx -FilePath \\ExServer1\Imports\Xxx.pst

You can use -received or -sent
Then -lt for less than
-gt for greater than
-ge for greater than or equal to

You should be able to just swap import for export, drop the bad item limit and then add the content filter in and the code you already have should work
0
 
LVL 3

Author Comment

by:MacGyver80
Comment Utility
Thank you irweazelwalls.

However, I'm trying to export the entire Mail Database.
0
 
LVL 18

Accepted Solution

by:
irweazelwallis earned 500 total points
Comment Utility
Ok so easy way is to use a CSC

Get-mailbox database xxx | get-mailbox | fl display name >c:\mailbox.csv

Take that csv and use in second script

$mailbox = import-csv c:\mailbox.csv

For each ($user in $mailbox) {new -mailboxexportrequest $user.displayname -file path \\server\share\$user.displayname.pst -content filter ....... }

File in what you want as content filter and the above should be mostly right (give or take a  typo or dodgy memory)
0
 
LVL 3

Author Closing Comment

by:MacGyver80
Comment Utility
Worked like a charm. Thank you for the guidance.
0

Featured Post

Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

Join & Write a Comment

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
In this video we show how to create a User Mailbox 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 Recipients >> Mailb…
In this video we show how to create a Distribution Group 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 Recipients >>…

772 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

10 Experts available now in Live!

Get 1:1 Help Now