Posts Tagged ‘export-mailbox’

Exchange 2007: How to export mailbox with management shell?

Monday, February 1st, 2010

image After releasing Exchange Server Service Pack 1 (SP1) Microsoft added new functionality called Export-Mailbox cmdlet for Exchange Management Shell.

The Export-Mailbox cmdlet exports all message types, including messages, calendar items, contacts, distribution lists, journal entries, tasks, notes, and documents. However, the Export-Mailbox cmdlet does not export rules.

To export data from a .pst file, you must run the Export-Mailbox cmdlet from a 32-bit computer that has the 32-bit version of the Exchange management tools and Outlook 2003 Service Pack 2 (SP2) or Outlook 2007 installed.

Well all prerequisites were in place; I opened the Exchange Management Shell and run the following command line:

[PS] C:\Documents and Settings\admin>Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst

Confirm
Are you sure you want to perform this action?
Exporting mailbox content from the mailbox ‘Gaag, van der Rob’ into .pst file ‘c:\gaagr.pst’. This operation may take a long time to
complete.
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
Export-Mailbox : Error was found for User1 (user1(at)networknet.nl) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error:
MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000, error code: -1056749164
At line:1 char:15
+ Export-Mailbox <<<<  -identity user1 -PSTFolderPath c:\user1.pst
    + CategoryInfo          : InvalidOperation: (0:Int32) [Export-Mailbox], RecipientTaskException
    + FullyQualifiedErrorId : DFCFF30D,Microsoft.Exchange.Management.RecipientTasks.ExportMailbox

The export failed. After reading some posts on Google I found the solution myself. I tried to export my own mailbox which worked fine so the problem has to be within the permissions set. To get full access run the Add-MailboxPermissions cmdlet.

Add-MailboxPermission -identity user1 -Accessrights FULLACCESS -User admin 
Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst 

With these steps I can develop a procedure to backup mailboxes when they are removed from the system.