Exchange 2000 / 2003 – Exporting Mail to .pst files with ExMerge

KB ID 0000091

Problem

ExMerge has been around for a long time, its used (as the name implies) to merge pst files into existing mailbox’s. However its also a great tool to export/backup users mail box’s if you’re doing a migration, or if you have got your “Disaster Recovery” hat on.

The following is a run through of how to export from a mail store to pst files – Note on a live system this can take some time, the example below was done in VMware on a test Exchange box that had 1000 users (as it was a test server the mailbox’s were tiny) If you need to do this on a production server plan in a LOT of time if your moving a large amount of data.

Solution

 

Note: I’ve mentioned it in the video, but just to reiterate, your mailbox’s need to be smaller than 2GB, if that can not be achieved, you can either;

1. Use ExMerge and export particular “date ranges” and produce multiple .pst files for the same mailbox (hopefully less than 2GB).

2. Use Outlook 2007 (or greater) to export the mailbox to .pst files individually.

Related Articles, References, Credits, or External Links

Download ExMerge 

Exchange 2010 Bulk Import .pst Files

Exchange 2007 – Export Mailbox’s to PST files

Outlook: Import and Export Data (.pst)

Backup and restore from .pst file

KB ID 0000154

Problem

You want to import your mail from an older version of Outlook  into your new Outlook mailbox, or you simply want to backup your mail.

Solution

Thankfully the process is the same for modern Outlook as it was for previous versions of Outlook.

1. In Outlook > Select the “File” Tab > Open > Open & Export > Import/Export

Note: On older versions of Outlook  its simply Open > Import (you select Import even if your going to Export!)

 

2. Export to a file.

3. Outlook Data File (.pst).

4. Select your mailbox, select the ailbox – {username} > To back up everything (calendar contacts the lot), tick “Include sub folders” > Next.

Note: If using a POP mail account, here it may say Personal Folders.

5. Choose a location to save the .pst file.

6. If you want to password protect this (remember someone can import your .pst and read all your mail). I usually leave this option blank > OK.

7. After a few seconds the mailbox will export. (Note: if the mailbox is very small this might happen so quickly nothing is displayed on the screen). And there it is.

To “Import” your mailbox,

1. Launch thewWizard as above (Step 1) > Select “Import from another program or file” > Next.

2. Outlook Data File (.pst) >Next.

3. Browse to, and select your .pst file > Next.

4. Stop and think! where do you want to import the files to? Select as appropriate > Finish (Note at this point if the .pst is password protected you will be prompted for a password).

Related Articles, References, Credits, or External Links

NA

Exchange Exporting Mailboxes to PST Files

KB ID 0001360

Problem

Applicable To: This procedure works on all versions of Exchange Newer than Exchange 2010 SP1 (update rollup 8). If your Exchange server is OLDER than that you will need to use the following link;

Exchange 2007 / 2010 (Pre SP1)- Export Mailbox’s to PST files

The following procedure exports a user mailbox to a PST file on a network share.

Solution

Note: Not Even ‘Exchange Organisation Administrators” have the right to import / export mailboxes, you need to grant those rights to your user object, (or a better approach would be to create an admin account just for this purpose, then delete it when you are finished).

[box]

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User {username}

[/box]

Note: This grants import, and export rights.

Create a file share on a drive with plenty of space, ensure the Exchange Trusted Subsystem has read / write access. And ensure the SYSTEM account has full control.

To create the ‘Export Request’

[box]

New-MailboxExportRequest -Mailbox “mailbox-alias” -FilePath \\server-name\share\file-name.pst

[/box]

Note: Add “-IsArchive” to the end of the command for Archive Mailboxes.
Note2: If the export repeatedly fails, add -BadItemLimit 200 to the end and try again, you can also use the -AcceptLargeDataLoss in exceptional circumstances

To view progress;

[box]

Get-MailboxExportRequest
OR
Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

 

[/box]

When complete, you need to remove the move request(s);

[box]Get-MailboxExportRequest | Remove-MailboxExportRequest
OR (If you still have movement requests running)
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest[/box]

Using Content Filters

You can specify a content filter to only export emails after a certain date all mail received after 01/01/17 e.g.

[box]New-MailboxExportRequest -Mailbox {mailbox-alias} -ContentFilter {(Received -lt ’01/01/2017’)} -FilePath \\{server-name}\{folder}\{file-name}.pst[/box]

Or to export emails between two dates;[box]New-MailboxExportRequest -ContentFilter {(Received -lt ’31/12/2018‘) -and (Received -gt ’31/12/2017′)} -Mailbox {mailbox-alias} -FilePath {server-name}\{folder}\{file-name}.pst[/box]

Using IncludeFolders (and Exclude Folders)

You can specify IncludeFolders (or ExcludeFolders) to only export emails from certain folders, e.g.

Only export Inbox (and sub-folders) and Sent Items;

New-MailboxExportRequest -IncludeFolders “#Inbox#/*”,”#SentItems#” -Mailbox {mailbox-alias} -FilePath \\{server-name}\{folder}\{file-name}.pst

Don’t Export Sent Items and Deleted Items;

New-MailboxExportRequest -ExcludeFolders “#SentItems#”,”#DeletedItems#” -Mailbox {mailbox-alias} -FilePath \\{server-name}\{folder}\{file-name}.pst

Export ALL Mailboxes to  PST

[box]foreach ($Mailbox in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $Mailbox -FilePath “\\{server-name}\{folder-name}\$($Mailbox.Alias).pst” }[/box]

Related Articles, References, Credits, or External Links

Exchange 2000 / 2003 – Exporting Mail to .pst files with ExMerge

Exchange (2010 Post SP1 and Newer) Bulk Importing Mail From PST Files

GFI MailArchiver

Deploying GFI MailArchiver with Exchange 2010, Using the Outlook Connector, Importing and Exporting Data.

KB ID 0000666

Problem

I’ve been involved with Exchange for a long time, either being directly responsible for it, or supporting others that do. And like all systems it would run a lot smoother if you kept users away from it! But unfortunately you can’t, so your system is probably full of users “Deleted Items” and “Sent Items” and a copy of every email that some users have ever received “Because I might need them”. And for years I’ve been saying “It’s a messaging system not a file storage system” and lecturing users about tidying up their inbox. Yes you can setup retention policies but most people don’t.

Even if you do have conscientious users, some of them click “Yes” when Outlook asks them “Would you like to Auto-Archive your old messages now?” Then you have PST files all over the place getting corrupted and not getting backed up.

In addition, just as techs like me are shouting at users to delete things, businesses are now finding that they need to keep ALL their digital messaging for things like Sarbanes-Oxley and Freedom of Information enquiries. Yes I’m sure you back up your Exchange server but what if you needed to produce a message thread about a particular project that was two years ago in the middle of a month?

Archiving

Is the process of taking a copy of mail messages as they pass through Exchange and copying them off to an external location, in this case a database. The advantage of doing this is that database can be on cheaper midline storage and (potentially) keeps the Exchange database sizes down. With Exchange this is done by setting up Journaling (that’s the process of sending a copy of all [or specified] mail to a journal users mailbox). MailArchiver then takes this mail and put it into its database.

Advantages

1. Performance: Getting all the ‘Old’ Data out of the exchange databases makes them smaller, and more efficient.

2. Elimination of PST files: There’s a big list of reasons why I don’t like PST files. If you’ve ever had a user lose email because of them, then as far as they’re concerned its YOUR fault. There are tools to import PST file into the database, (and to export as well).

3. Disaster Recovery: How nice would it be, the next time users email message ‘disappears’ (Users never delete emails they just disappear), they could restore it themselves, from within Outlook. the Outlook Mail Connector software will do this. Also your backup window for Exchange will be a lot smaller.

4. Compliance: Saving a copy of all messages in a database has the advantage, that it’s searchable, and you can export the data you find in a format that you can import straight back into Exchange or send to someone.

5. Investigation: MailArchiver provides some powerful search and reporting tools. If your HR department needed to see who said what to who about projectXYZ then using conventional methods would be a nightmare.

Solution

GFI MailArchiver 2012 Installation and Configuration

Enabling Journaling in Exchange 2010

Note: GFI Mail Archive setup can do this for you but I prefer to do things manually.

1. Launch the Exchange System Management Console > Recipient Configuration > Mailbox > New Mailbox.

2. User Mailbox > Give it a name and set the password > Don’t create an archive > New > Finish.

3. Option 1: Standard Journaling can be enabled on a mailbox store > Organisational Configuration > Mailbox > Locate the store> Properties.

4. Maintenance tab > Tick Journal recipient then browse for the user you created > Apply OK.

5. Option 2: (Note: Requires an Exchange Enterprise CAL) This is set up using a Journaling rule > Organizational Configuration > Hub Transport > Journal Rules > New Journal Rule.

6. Give the rule a name > Browse for the user you created earlier > Set the scope (in most cases you will want global) > New > Finish.

7. To test it’s working send and email then log on as your ‘Journal’ user and make sure you have a copy in the inbox.

Installing GFI MailArchiver 2012

8. Before installing the GFI MailArchiver server needs the Exchange MAPI Client and Collaboration Data Objects 1.2.1 (Unless you are installing it on the Exchanges server).

9. Also (though not essential) I prefer to disable IE Enhanced Security Configuration, so IE wont get upset with the management console.

10. You can add the URL to trusted sites if you want, but I’m not a fan of IE ESC anyway so I simply disable it.

11. Now run the GFI MailArchiver installer.

12. Now this I DO LIKE, why can’t Exchange do this! These are the server pre-requisites, rather than just falling over and giving you an error (I’m looking at you Windows Exchange Developers!) It offers to do the hard work for you. It takes a while though, best go for a coffee at this point > Next > Select whether you want to check for a newer version > Accept the EULA > Set the destination folder > Next.

13. Here the default setting, WARNING if you already have web services on this server (or even UPS software using port 80), have a common sense check.

Note: If you are not sure, the following command will tell you if port 80 (http) is in use;

[box]netstat -aon | find “:80″[/box]

14. Select Install > Finish.

Configuring MailArchiver 2012

15. The GFI MailArchiver management console will launch > Configure.

16. Next.

17. Enter your licence key and select verify licence key > Next.

18. Next.

19. In this example I’m using the Firebird database, in a production environment you should be using SQL server > Next.

20. Change the paths if required > Enter some domain credentials> Next.

21. Next

22. Next

23. Next

24. I’m selecting Auto > Next

25. As I set the user up myself I’m choosing Manual > Next.

26. Exchange Web Services seems to be less problematic > Enter your Journal user account > Next.

27. Next.

28. Finish.

29. We are now up and configured.

GFI MailArchiver – Outlook Connector, Import and Export

GFI MailArchiver – Using the Outlook Connector

30. Firstly you need to enable ‘Mailbox Folder Structure Retrieval’ on the GFI server > Launch the MailArchiver Management console.

31. Mailbox Folder Structure Retrieval.

32. Change Settings.

33. Enter a user account to connect to Exchange Web Services with, here I’m using my domain admin, whichever account you use needs to have administrative access on the Exchange and the GFI server. It also (domain admin included) needs the following Powershell commands running on the Exchange server before it will work, (change the user name to match your own);

[box]New-ManagementScope -name “MAUMPolling” -recipientrestrictionfilter {recipienttype -eq “UserMailbox”}</p> <p>New-ManagementRoleAssignment -name “MAUMPollingRA” -role:applicationimpersonation -user “administrator@petenetlive.net” -customrecipientwritescope “MAUMpolling”[/box]

34. Next.

35. Finish.

Installing the Outlook Connector on a Client

36. I’ve already got a client PC setup with Outlook 2010.

37. I’m just connecting to the GFI servers management URL from the client and downloading the Outlook Connector.

Note: The versions are for Outlook 32 bit and Outlook 64 bit, even if your Windows client is 64 bit you may still be running 32 bit Outlook/Office. If you get it wrong it will tell you your version of Office is not supported.

38. Install the client software, accept the defaults, all you need to specify is the URL of the GFI MailArchiver server.

39. Now when your user opens Outlook, they get an additional mailbox called “GFI MailArchiver Mailbox” that carries a copy of ALL the users mail (Note: Not the mail from before the product was installed, to import that see the import section below, and choose ‘Import for Exchange mailbox’. In addition each user now has a MailArchiver tool bar from which they can search for their mails.

Note: If a user ‘loses’ a mail they can simply drag a copy from their GFI mailbox to their live inbox.

GFI MailArchiver – Importing Data from PST Files

Note: To do this the machine needs to have Outlook installed on it (and NOT Outlook 64 bit!)

40. Launch the GFI MailArchiver Import and Export Tool.

41. Import from .pst files.

42. Add PST file > Browse to your PST file > Open.

43. Select the folder(s) required > Next

44. Select a date range > Select the user that will own the imported data > Next.

Note: I’d rather have an “Import Everything” option!

45. When complete > Finish.

46. Now that user will have the imported mail as well (Note: The default view is “Emails in last 30 days” so don’t panic if you don’t see it all).

GFI MailArchiver – Exporting Data to PST File

47. Launch the GFI MailArchiver Import and Export Tool.

48. Enter the URL of the GFI server > Verify > Ensure it says OK > Next.

49. Select what you want to export (I’m going to search for email containing particular words) > Next.

50. Type in your search text > Find > Next.

51. Here you can restore the mail to a mailbox, export it to .msg or .eml format, or my old nemesis .pst files, I’ll choose the latter > Next.

52. And there’s my .pst file, ready to be sent out to satisfy my freedom of Information enquiry.

 

Related Articles, References, Credits, or External Links

NA

Outlook Install Error ‘Outlook may not be installed with a newer version of Outlook’

KB ID 0000665 

Problem

I saw this whilst installing Office on a machine today.

Solution

1. In my case I had just removed Office 2010 x64, (I needed the x32 bit version for some PST/MAPI stuff). So I knew that there was not a version of office installed.

Note: If you are unsure, click Start > appwiz.cpl {enter} and MAKE SURE. Remember most PC’s come with a trial version of Office these days, and that’s the most likely culprit!

2. Once you have discounted the obvious, make sure you DO NOT have any ‘Collaboration and Data Objects’ still installed, if so remove them (that was my problem).

Related Articles, References, Credits, or External Links

NA

 

Exchange PST Import Error – ‘Couldn’t connect to the target mailbox’

KB ID 0000801

Problem

I was trying to import some PST files into SBS 2011, and got the following error;

Couldn’t connect to the target mailbox

Solution

Before you proceed, make sure the user you are logged in as, and are attempting to perform the New-MainboxImportRequest command has been granted the rights to carry out mailbox imports, read the following article;

Exchange 2010 (Post SP1) Bulk Importing Mail From pst Files

Note: If the machine you are importing into is part of a CAS array you may also see this error, to fix that problem you need to create a temporary mail database and move the target mailbox into it, then change the RpcCLientAccessServer property for that database, like so;

[box] set-MailboxDatabase TEMPDB -RpcClientAccessServer Exchange01.petenetlive.com[/box]

1. Make sure the folder you are importing from (this has to be a UNC path NOT a path to local folder!) has permissions granted to it for the Trusted Exchange Subsystem group.

2. If your machine is also a global catalog server, (Note: As mine is an SBS server, and the only DC I don’t really have a choice.) You may find that the ‘Microsoft Exchange RPC Client Access’ service is not running, start it manually then attempt the import again.

 

Related Articles, References, Credits, or External Links

NA

 

Exchange: Importing Mail From PST Files (including Bulk Importing)

KB ID 0000443

Problem

If you have mail in .PST file format that you would like to import, either exported via ExMerge from an older Exchange server, or Exported via Outlook, or even exported via PowerShell, then the process for importing that mail into Exchange has been the same since Exchange 2010 (SP1).

Before SP1 you would have to install a copy of Outlook on the Exchange server and use a PowerShell command that looks like this (once you had granted Import/Export rights);

[box]

BEFORE Exchange 2010 SP1

Get-Mailbox | Import-Mailbox –PSTFolderPath C:Folder_Containing_PST_Files

[/box]

 

However try that after SP1 and you will get an error message, saying that Import-Mailbox is not a commandlet. That’s because now you no longer use this command you use “New-MailboxImportRequest”, and you also no longer need Outlook installing on the server.

How To Import PST Files

Note: To Bulk Import (See Below)

Firstly make sure the folder you are importing from is shared and the ‘Exchange Trusted Subsystem’ has read permissions, and SYSTEM has full control.

Grant the user you you want to Import the PST file with the appropriate permissions;

[box]New-ManagementRoleAssignment –Role “Mailbox Import Export” –User {username}[/box]

Note: This grants import and export rights, if you want to grant these permissions to a ‘group’ then see instructions below.

To submit the import request;

[box]New-MailboxImportRequest-FilePath \\{server-name}\{folder-name}\{filename}.pst -Mailbox “{mailbox-user}”[/box]

To check progress;

[box]Get-MailboxImportRequest
OR
Get-MailboxImportRequest | Get-MailboxImportRequestStatistics[/box]

If Mailbox Importing Fails

To troubleshoot failures, try using the following command and analysing the output;

[box]Get-MailboxImportRequest | Get-MailboxImportRequestStatistics -IncludeReport | fl [/box]

i.e. below you can see the problem was;

“This mailbox exceeded the maximum number of large items that were specified for this request. (Fatal error TooManyLargeItemsPermanentException has occurred.)”

To fix that error you can use the ‘-LargeItemLimit 200 -AcceptLargeDataLoss’ flags (which sounds alarming, but I have not seen it break anything in the last ten years).

Importing PST Files From the Exchange Admin Center

You can import PST files directly in the management GUI > Recipients > Mailboxes > Select the target mailbox > {Ellipses} > Import PST.

Enter the path to the .PST file > Next.

Select the target mailbox > Next.

Optional: Select a user to be emailed an export report.

Note: To view progress and troubleshoot failures, you will have to revert to PowerShell.

How To BULK Import .PST Files

Note: To BULK Import successfully, the .PST file MUST have the same name as the alias of the target mailbox.

Commands Required

1. Once you have created a “Universal Security Group” in this example called “Mailbox_Import” then assign the mailbox import/export roles with the following command;

[box] New-ManagementRoleAssignment –Name “MailboxImportExport” –SecurityGroup “Mailbox_Import” –Role “Mailbox Import Export” [/box]

Note: If you create a ‘global security group’ you will see an error when you try to import.

2. Remember to log off and back on as the user in question before proceeding.

3. To Start the bulk import use the following command, (all you should need to change is the UNC path to the folder with the .pst files in);

[box] Dir DC2APST_To_Import*.pst | %{ New-MailboxImportRequest -Name BulkPSTImport -BatchName Recovered -Mailbox $_.BaseName -FilePath $_.FullName} [/box]

4. Check on progress with the following four commands;

[box]

Get-MailboxImportRequest -Status Completed
Get-MailboxImportRequest -Status Queued
Get-MailboxImportRequest -Status InProgress
Get-MailboxImportRequest -Status Failed

[/box]

5. When finished, flush the requests with;

[box]

Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest
Get-MailboxImportRequest -Status Failed | Remove-MailboxImportRequest

[/box]

Note: Enter “A” To accept multiple removes at once.

If New-MailboxImportRequest Fails

Firstly you need to find out why it failed, to do that you need to generate an error log.

[box] Get-MailboxImportRequest | Get-MailboxImportRequestStatistics -IncludeReport | fl >errorlog.txt[/box]

Then open that log file, to see what it says.

Common Errors

FailureType : TooManyBadItemsPermanentException Message : Error: This mailbox exceeded the maximum number of corrupted items that were specified for this move request.

This happens when it sees items in the mailbox it does not like, or considers corrupt. To get round this problem, import the .pst file on its own with the following command;

[box] New-MailboxImportRequest -Mailbox joe.soap -FilePath “DC2APST_TO_IMPORTjoe.soap.PST” -BadItemLimit 200 -AcceptLargeDataLoss[/box]

FailureType : MapiExceptionShutoffQuotaExceeded Message : Error: MapiExceptionShutoffQuotaExceeded: Unable to save changes. (hr=0x80004005, ec=12 45)

This happens if you have a limit on the mailbox size, and to import from this PST file would break that restriction.

FailureType : MailboxReplicationPermanentException Message : Error: serverfolderfilename.pst –> Page map offset {number} is greater than buffer length {number}.

This happens because you exported a PST file either using ExMerge or an older version of Outlook and it’s too big. Make sure it’s well under 2GB.

Additionally

If you want to import the “Old” mail into a folder within the target users mailbox, you can use the following command instead of the one in step 3;

[box] Dir DC2APST_To_Import*.pst | %{ New-MailboxImportRequest -Name RecoveredPST -BatchName Recovered -Mailbox $_.BaseName -FilePath $_.FullName -TargetRootFolder Imported_Mail} [/box]

Related Articles, References, Credits, or External Links

Exchange Exporting Mailboxes to PST Files

Exchange 2000/2003 Exporting mailbox’s with ExMerge

Exchange 2007 – Export Mailbox’s to PST files