Intelligent Message Filter, Content Filter, can do more...

WinDeveloper IMF Tune
WinDeveloper IMF Tune
  • Home
  • ExMerge
  • Exchange 2010 Import-Mailbox and Export-Mailbox

Exchange 2010 Import-Mailbox and Export-Mailbox

Alexander Zammit

Alexander Zammit Photo

Software Development Consultant. Involved in the development of various Enterprise software solutions. Today focused on Blockchain and DLT technologies.

Cast your Vote
Poor Excellent

Exchange 2010 introduced significant changes in the usage requirements of the Import-Mailbox and Export-Mailbox cmdlets. If performing brick level backups, or migrating mailboxes with the help of PSTs, this article will get you started.

Exchange 2010 made significant advancements in providing out-of-the-box Archiving, together with improved High Availability and Resilience functionality. This is likely to cause a decline in demand for brick level backups. Nevertheless, the occasional need to transfer mailbox content to/from PSTs is unlikely to go away completely.

From ExMerge to Import-Mailbox/Export-Mailbox

Do you remember the time when Exchange 2007 was released and Service Pack 1 was not yet available? In those days, many were angry for not having a supported method to export/import mailboxes to/from PSTs. ExMerge, the tool of choice in Exchange 2003 and earlier, was on its way out making space for the new export-mailbox and import-mailbox cmdlets. Exchange 2007 SP1, apart for filling this void, also addressed some major ExMerge limitations. Most notably it brought Unicode support and the ability to have PSTs larger than 2GB.

Despite the advancements, the Exchange 2007 cmdlets still shared a common characteristic with ExMerge. This was the intricate procedure in getting the functionality to work. In the past we dedicated three articles discussing the setup requirements in different scenarios:

Meeting the ExMerge Requirements

Using ExMerge with Exchange 2007

Replacing ExMerge by Import-Mailbox and Export-Mailbox

It Started with an Error!

Having written an article on setting up these cmdlets in Exchange 2007, I was uncertain if there would be any need to revisit this topic. I changed my mind as soon as I saw the error export-mailbox returned on Exchange 2010:

"To export to or import from a .pst file, the 64-bit version of Outlook 2010 or later must be installed on the server to which you are connecting (HAMRUN.wtest-dom1.local)."

Outlook 2010 Requirement

Following that error I looked up the Export-Mailbox TechNet documentation, and found this:

"To export data from a .pst file, you must run the Export-Mailbox cmdlet against an Exchange server that has the 64-bit version of Microsoft Outlook 2010 installed. We recommend that you run the command on a dedicated Exchange server that doesn't have any mailboxes."

These two bits of information immediately highlight some changes in the cmdlet usage requirements.

  1. Outlook 2010 - Outlook was also required in Exchange 2007 since it provided the necessary PST drivers. So the need for the latest Outlook version is not surprising.

  2. 64-bit - This is already more interesting. Exchange 2007 required the use of a 32-bit platform. We had to install the Exchange 2007 32-bit Management Tools on Windows XP (for example) and run the cmdlets from there. Exchange 2010 does not provide a 32-bit build any longer and quite obviously the 2010 cmdlets had to support 64-bit platforms.

  3. Install Outlook on an Exchange 2010 mailbox server! - This is the one that took me by surprise. In Exchange 2007 we had to setup a separate machine from which to run these cmdlets. It is now a requirement to install Outlook on the Exchange server and run the cmdlets from there. Actually we can run the cmdlets from another machine (will see this later), however the key point is the need to install Outlook on an Exchange mailbox server.

As the previously quoted TechNet documentation explains, the recommended setup is to have a dedicated Exchange server that doesn't have any mailboxes.

So far I did not come across any official information regarding the supported configurations where Outlook 2010 and Exchange 2010 can be run on the same machine. Please post a comment if you come across anything in this regard. Quite obviously having Outlook on a dedicated Exchange Mailbox server without mailboxes should be supported. However I can imagine that smaller shops with a single server setup won't be keen to go that way.

Account Rights

Apart for the already listed changes, there is a fourth very welcome improvement. In Exchange 2007 and earlier, assigning the necessary rights for a user to perform the import/export operations used to be the most troublesome part. Most notably the user had to be assigned rights on all mailboxes against which the cmdlets were to be run.

Exchange 2010 greatly simplifies matters. As we shall see, with the new Exchange 2010 Role Based Access Control (RBAC), all that is necessary is to assign the user the "Mailbox Import Export" role.

Setup Procedure

Now that we know all the relevant changes introduced in Exchange 2010, preparing a machine to run these cmdlets is fairly simple:

  1. Install Exchange 2010 Mailbox Server. We discussed the basic Exchange installation steps in Installing Exchange 2010 Beta. On my test network I worked with a single server having Hub, Client Access and Mailbox server roles installed. Considering that at the time of writing Outlook 2010 is still beta I would definitely not recommend doing this on your live server.

    One option is to wait for Outlook 2010 to be final. Hopefully the Outlook support status will be fully clarified by then. Otherwise if you cannot wait, the dedicated server option sounds safe especially since such a server can easily be decommissioned if the necessity arises.

  2. Download and install Outlook 2010 on the Exchange Server. Of course you don't need the entire Office 2010, only Outlook:

    Outlook 2010 Installation

  3. Open the Exchange Management Shell and assign the user account the "Mailbox Import Export". Here I am assigning the role to the Administrator account:

    New-ManagementRoleAssignment -Role "Mailbox Import Export" -User Administrator

    RBAC Mailbox Import Export role

    Following that, I had to reopen the command shell for the Role assignment to take effect.

This is it; the Administrator will now be able to run the import-mailbox/export-mailbox cmdlets.

Note1: On my test network I was able to get the system to work without ever opening Outlook. Of course I also tested the system following the setup of an Outlook profile and everything worked fine. So as far as I can tell whether or not Outlook is configured should make no difference.

Note2: Unless the "Mailbox Import Export" role is assigned, running the cmdlets returns an error that could be confusing:

"The term 'export-mailbox' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

RBAC Role Not Assigned

Running the Import/Export from another Machine

It is also possible to run the cmdlets from a machine other than Exchange, however there's a catch. First of all this won't save you from having to install Outlook on to the Exchange server. So you will still need to follow the setup procedure on the Exchange Mailbox server discussed earlier.

Following that, install the Exchange 2010 Management Tools on another 64-bit machine. In my case I am using Windows 7.

Exchange 2010 Administrative Tools

That's it, users having the "Mailbox Import Export" role are now able to run the cmdlets. Note how I did not even install Outlook on the Windows 7 machine.

However, as promised there's a catch. Even though you are running the cmdlets from another machine the operation is actually carried out on the Exchange server where Outlook is installed. This means that if for example you want to export a mailbox with the command:

Export-mailbox -Identity alex -PSTFolderPath c:\Mailboxes

The path C:\Mailboxes is actually referencing a location on your server machine and not the local machine.

Final Tips

The Exchange 2010 setup necessary to run the import-mailbox/export-mailbox cmdlets changed significantly from its predecessor. With the help of RBAC, assigning the necessary rights for running the cmdlets, has been greatly simplified.

The new Exchange 2010 Archiving and High Availability features will hopefully diminish the need for these cmdlets. In any case if the necessity arises, you are now ready to get everything up and running.

References

Replacing ExMerge by Import-Mailbox and Export-Mailbox

Download and install Outlook 2010

Export-Mailbox TechNet documentation

User Comments - Page 1 of 1

Andrew Jackson 6 Sep 2014 08:58
This looks like a great solution. However the link to the "Download and install Outlook 2010 64-bit" is not working. MS seem to have changed or re-directed that.

Any ideas where one can now download this?
Andy Groll - USAB 26 Apr 2012 12:50
I had to deal with a messed up Exchange 2010 server with no SP1. Installing SP1 was not an option as that server would go away anyway (company merger). Server was simply to flaky.
Here is what I did:
Set up a Win7 64bit machine, installed Outlook 64bit version. Installed Exchange 2010 Management Tools.
Used Windows Power Shell (not Exchange Power Shell).
Loaded the EMS snapin (run Import System Tools). Then ran the mailbox-export commands.
PST files are then being created on the local PC because it is being run from the local Windows Power Shell.
Allen Whte 7 Feb 2011 06:48
Thanks, was buggin me where they had went to, got it fixed with yours and another article.
Alexander Zammit 9 Oct 2010 13:20
Exchange 2010 SP1 introduced significant improvments in this area. For details check this:

http://www.exchangeinbox.com/article.aspx?i=162
Guillermo Larkin 31 Aug 2010 13:03
You do not have to install Outlook on a mailbox server to get this to work. You do need the Exchange Management Tools and Outlook 2010 on another box. Then start PowerShell (not the Exchange Management Shell) and load the EMS snapin with the following command: "Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010". Then run the import/export-mailbox cmdlet.
DBlack 24 Aug 2010 07:00
There is a bug in Exchange 2010 which requires the modification of the Exchange database object security settings in ADSI edit if you are attempting to perform a single server stand-alone installation. I.E. the single server will hold all the Exchange roles (Hub, Cas, MBX). This is in addition to a few other basic items.

1. The System account needs to have the following permissions:
- Read
- Administer Information Store
- Allow Impersonation to Personal Exchange
- Create Named Properties in Information Store
- Open Mail Send Queue
- Receive As
- Send As
- View Information Store Status

2. Need to execute < New-ManagementRoleAssignment -Role "Mailbox Import Export" -user username > from the Exchange Pshell.

3. Outlook 2010 x64 needs to be installed locally on the server performing the Import/Exports.
Carlos Lopez 4 Aug 2010 12:30
I was able to export to .pst from a server with win2008R2 with exchange management tools & outlook 2010 x64 without installing mailbox role.

Instead of using exchange management shell I open the local power shell with import system modules option. This is located by right-cliking on the poweshell button on the taskbar.
When executed it will import exchange modules to the local shell.
Export-Mailbox, Exchange 2010 23 Jun 2010 06:56
http://technet.microsoft.com/en-us/library/ee633478.aspx

Note: You can't use the EMC to export data from mailboxes.

Prerequisites: To export data from a .pst file, you must run the Export-Mailbox cmdlet against a 64-bit computer that has the following installed:

Microsoft Exchange Server 2010 role
64-bit Microsoft Outlook 2010

You must have the correct permissions to import or export mailbox data. By default, none of the preloaded role groups contain the Mailbox Import Export role. Therefore, you must add the Mailbox Import Export role to a role group. For more information, see Add the Mailbox Import Export Role to a Role Group, http://technet.microsoft.com/en-us/library/ee633452.aspx
zauzza 11 May 2010 07:34
Dear Alex,

this is not related to the article actually..but i really need ur help..
I want to use the "Get-Mailbox" command in Exchange 2007 to get the following statistics for all mailboxes all in one text:
last login date, current disk space (total item count), qouta(storge group ) , organizational unit and E-mail address ..

thanks in advance
Tom 29 Apr 2010 04:19
Thanks - Same error... does not make any sense
Alexander Zammit 28 Apr 2010 12:38
@Tom

New-ManagementRoleAssignment -Role "Mailbox Import Export" -User Administrator


Tom 28 Apr 2010 12:17
I get the error below even though I have the role for Org Mgmt. I have tried against both dom admin and a non admin acct...what am I missing?


You don't have access to create, change, or remove the "Mailbox Import Export-tphilli management role assignment.
ust be assigned a delegating role assignment to the management role or its parent in the hierarchy without a scope
riction.
+ CategoryInfo : InvalidOperation: (Mailbox Import Export-tphilli:ADObjectId) [New-ManagementRoleAssi
nt], InvalidOperationException
+ FullyQualifiedErrorId : 78779DD3,Microsoft.Exchange.Management.RbacTasks.NewManagementRoleAssignment
TNA 27 Apr 2010 14:45
http://www.thenetworkadministrator.net/index.php/2010/04/exchange-2010-error-error-code-2147221219-when-running-the-export-mailbox-command/
Chimera 14 Apr 2010 04:04
Make sure you download and install the 64 bit version of Outlook, 32 bit version does not work
Alexander Zammit 28 Mar 2010 01:11
Will do some tests and let you know.
Mike Crowley 27 Mar 2010 08:22
Have you seen this? I can't get it working, and others suggest a bug?
http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/886a6c39-b975-408a-827c-fb3c07ea579b
Mike Crowley 25 Mar 2010 12:30
Great Article! Please update it when Microsoft elaborates on the Outlook 2010 requirements.
Copyright © 2005 - 2024 All rights reserved. ExchangeInbox.com is not affiliated with Microsoft Corporation