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.
Get-MailboxExportRequest | Where { $_.Status –eq ‘Completed’ } | Remove-MailboxExportRequest –Confirm:$False
Note:
Using –Confirm:$False saves a lot of time because using default values for each request, a confirmation action will be required.
Using –Confirm:$False saves a lot of time because using default values for each request, a confirmation action will be required.
Figure 06
We can also use grid view to help removing requests. Let’s start running the following cmdlet:
Get-MailboxExportRequest | Out-GridView –PassThru | Remove-MailboxExportRequest
The results can be seen in Figure 07, where the administrator can select one or more items from the list and clickOK. 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.
New-MailboxExportRequest <Mailbox> -FilePath <EXUtil-Shared-Folder-on-Exchange>
Note:
The Mailbox can be an alias, SMTP or Display name.
The Mailbox can be an alias, SMTP or Display name.
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
Post a Comment