Introduction

In our last article we used the EAC (Exchange Admin Center) to export/import PST files using a Shared Folder. In this article we will check the status of previous export/import processes and then go to some advanced configurations that we can do using Exchange Management Shell.

Checking the status of the Import/Export Process

The process to check the Import and Export process using Exchange Management Shell is based on the same concept. We just need to change the cmdlet from *-MailboxExportRequest to *-MailboxImportRequest. So, use this as a reference when checking the following cmdlets.

In order to see what is going on we can run the Get-MailboxExportRequest as shown in Figure 01. By default, we are going to have three columns: name, Mailbox and status.

Figure 01

In order to get more details about the process we can run Get-MailboxExportRequest | fl and all details will be listed as shown in Figure 02.

Figure 02

If you have several entries in the list you can always use the mailbox information in the same cmdlet to make life easier (Figure 03). The name of a request, when not specified is going to be the AD location of the mailbox plus MailboxExport (or MailboxImport) for the first one and then incremented by 1 (one).

Figure 03

In some cases, we need to check the status of the last operation and it can be useful for troubleshooting as well. We can use the same cmdlet that we have been using and adding the switch –report to get the historical information of the previous run, as shown in Figure 04.

Figure 04

Cleaning-up the Requests...

By default, each Mailbox Import/Export request will have the name MailboxExportX, where X is a number starting from 1 to 9 and after that the cmdlet will ask you to name your new requests.

Bear in mind that we are going to focus on the Export process, however you can replace the Export string on all cmdlets below to Import and get the same results.

In order to check the existent requests we can use Get-MailboxExportRequets and a list of all current requests (Name, Mailbox and Status) will be listed as shown in Figure 05.

Figure 05

If you want to remove all Completed requests we can use the cmdlet shown below to remove all existent entries, the same cmdlet in action is shown in Figure 06.

The results can be seen in Figure 07, where the administrator can select one or more items from the list and click OK. This will trigger the removal of that item. Pretty cool, isn’t it?

Figure 07

Again the –Confirm:$False is key to avoid getting annoying messages. If we don’t add this parameter, then we have to go back to the PowerShell to confirm the action. In order to avoid this default behavior, add such parameters as shown in Figure 08. By doing that your grid-view experience with removing entries will be much better.

Figure 08

Exporting to PST using Exchange Management Shell

In order to Export to a PST there are only two required parameters: Mailbox and a PST location. If we want just to export the entire content, we can run the cmdlet shown below and the result will be a request being queued as shown in Figure 09.

With Exchange Management Shell, we have several parameters to help us out to perform granular PST exports. A good example is to generate a PST of a couple of mailboxes in the same PST file. This can be easily achieved using Exchange Management Shell. Basically, we just need to run 3 Exports using the same file and we can also create a folder for each source mailbox using the –TargetRootFolder as shown in Figure 10.

Figure 10

The result on the PST will be similar to the one shown in Figure 11.

Figure 11

You may be wondering, how about Archives? Well they are covered by just adding –IsArchive in the cmdlet and the PST generated will have the Archive Mailbox as source instead of the regular user mailbox.

We can also manage folders to be included or excluded by specifying parameters. If you have localized clients you can always use #Inbox# and that will apply for the Inbox in the other language as well, and that also applies to any other default system folder. This way you can use the same script across multiple sites/locations. Here are a couple of interesting parameters that we can add to a New-MailboxExportRequest cmdlet.

ExcludeDumpter
We define if the Recovery Deleted Items will be part of the PST

ExcludeFolders
We can define a list of folders that will be removed from the PST export process.

IncludeFolders
In this parameter we can define which folders will be included in the PST export process.

The last but not least is the –ContentFilter parameter where the administrator can set advanced filters where only messages that match the filter specified will be exported to a PST. With ContentFilter the administrator can filter by time range, recipient, sender, such as date range, sender and recipient, attachment names, participants and so forth.

Importing from PST using Exchange Management Shell

The import process is when data located in a PST file is moved to a mailbox or Archive mailbox in the Exchange Server environment.

Note:
When importing PST files, a good thing to keep in mind is that the cmdlet will import whatever data you have in the PST into the mailbox specified, in other words, there is no validation of the content being imported. It is highly recommended to check the PST and mailbox to avoid wrong data being imported into a mailbox/archive.

The basic cmdlet to import any given PST to a mailbox is described in the following syntax:

New-MailboxImportRequest <mailbox> -FilePath <\\UNCPath\file.pst

A question that keeps coming on the Forums is: how do I restore a PST to an Online Archive mailbox? That can be done using the same –IsArchive parameter, the following syntax can be used:

Note:
In Figure 12 the account was on the same server, however we can replace Get-ChildItem *.pst for Get-ChildItem \\server\sharedfolder\*.pst and we will have the same result without logging on the server that has the PSTs locally.

Figure 12

Conclusion

In this article, we went through the process of using Exchange Management Shell to manage the existent requests and covered also how to import and export requests using some of parameters that are available only when using PowerShell.

Read Next

Author

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides of the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange, CISSP and several other certifications. Anderson contributes to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at Techgenix.com, MSExchange.org, ITPROCentral.com and Anderson Patricio.org (Portuguese).

Latest Podcast

Featured Freeware

Recommended

Follow Us

Managing PST Import-Export process in Exchange Server 2013 (Part 2)

TECHGENIX

TechGenix reaches millions of IT Professionals every month, and has set the standard for providing free technical content through its growing family of websites, empowering them with the answers and tools that are needed to set up, configure, maintain and enhance their networks.