?
Solved

Export all mailboxes Exchange 2010

Posted on 2014-10-01
10
Medium Priority
?
103 Views
Last Modified: 2014-10-15
i'm running an Exchange 2010 standaard server and want to export all mails before 31 december 2012 for every user mailbox. The original mail should be delete from the mailbox. Im using below command to test it for one mailbox, but that failed. I get see why. I know that some commands are missing in the commandline, but i'm stucked.

New-MailboxExportRequest -ContentFilter {(Received -lt '12/31/2000') -and (Received -gt '12/31/2012')} -Mailbox "NAMEmb" -Name Jobexport -FilePath \\server\path\file.pst

Open in new window




How can i do the export for All my usermailboxes?
0
Comment
Question by:sitpro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 

Author Comment

by:sitpro
ID: 40354021
Also i need to export or delete all mail with specific text (exact match, example:  "this need to be found" ) in the body in this timerange.
0
 
LVL 1

Expert Comment

by:foxcon
ID: 40354053
How to Export All the Mailboxes using a Specified date

Step 1:

Open Exchange Management Shell

$Export = Get-Mailbox
(Saving to a Variable)

 

 

Step 2:

 

Specifying lesser than (lt) 01-01-2012

$Export|%{$_|New-MailboxExportRequest -ContentFilter {(Received -lt "01/01-2012")} -FilePath file://servername/pst/$($_.alias).pst}
0
 

Author Comment

by:sitpro
ID: 40354318
Hi Foxcon,

commandline works not with your filepath. It works with: FilePath \\servername\pst/$($_.alias).pst}

Two questions:

1. whats the option to delete the original mails in the mailbox after this export?
2. whats the commandline to do the same but with specific text (exact match, example:  "this need to be found" ) in the body. With and a sperate command without the timerange?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:foxcon
ID: 40354353
Hi Sitpro

According to MS: -

[-ContentKeywords <String[]>] should do the trick.
0
 
LVL 1

Expert Comment

by:foxcon
ID: 40354356
On point 1.

[-DeleteContent <SwitchParameter>]

However, I would be tempted to export mailboxes, confirm your exports and then re run script to delete once exported.
0
 

Author Comment

by:sitpro
ID: 40354404
when using this command:
$Export|%{$_|New-MailboxExportRequest -ContentFilter {(Received -lt "01/01-2010")} -FilePath \\serverpath\share\$($_.alias).pst} -DeleteContent

i get this error:
ForEach-Object : Cannot bind parameter 'Process'. Cannot convert the "-DeleteContent" value of type "System.String" to type "System.Management.Automation.ScriptBlock".

I would be very pleased if you can give me the full working command. I not familiar enough with the powershell options.
0
 
LVL 1

Expert Comment

by:foxcon
ID: 40354424
You can use the Search-Mailbox cmdlet to search and delete messages from a mailbox.

To search and delete messages in one step, run the Search-Mailbox cmdlet with the DeleteContent switch. However, when you do this, you can't preview search results or generate a log of messages that will be returned by the search, and you may inadvertently delete messages that you didn't intend to. To preview a log of the messages found in the search before they're deleted, run the Search-Mailbox cmdlet with the LogOnly switch.

As an additional safeguard, you can first copy the messages to another mailbox by using the TargetMailbox and TargetFolder parameters. By doing this, you retain a copy of the deleted messages in case you need to access them again.

Search-Mailbox -Identity "April Stewart" -SearchQuery "Subject:'Your bank statement'" -TargetMailbox "administrator" -TargetFolder "SearchAndDeleteLog" -LogOnly -LogLevel Full

Search-Mailbox -Identity "April Stewart" -SearchQuery "Subject:'Your bank statement'" -DeleteContent

However with Search-Mailbox you need to use the Advanced Query Syntax (AQS) rather than -ContentFilter
0
 

Author Comment

by:sitpro
ID: 40355392
With below cmdlet I exported all mailbox data between the specific date to pst.

But does this work for all received data in ALL subfolder?
Do i need to change "Received" to "sent" to do it for the sent folder?

$Export|%{$_|New-MailboxExportRequest -ContentFilter {(Received -lt "01/01-2006")} -FilePath \\server\share\$($_.alias).pst}

Open in new window



 But still i need to know the syntax for the following:

- remove data in specific period for ALL exchange users for ALL folder (inbox, subs, sent, etc.)
the cmdlet you write does only do it for 1 specific mailbox and not between a specific timeperiod.

- remove data in specific period AND ALSO specific words for ALL exchange users for ALL folder (inbox, subs, sent, etc.)
0
 

Accepted Solution

by:
sitpro earned 0 total points
ID: 40372926
It wasn't possible to do it with de Exchange shell. Therefor i use this tool: http://www.lucid8.com/product/digiscope.asp
0
 

Author Closing Comment

by:sitpro
ID: 40381716
.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Suggested Courses

762 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