How to Export Exchange Contacts to PST Using PowerShell Commands?

Exporting Exchange contacts to PST is a common requirement for organizations to maintain a backup or migrate data from one system to another. While there are multiple ways to achieve this, using PowerShell commands is one of the easiest and most efficient methods. In this article, we will guide you through the process of exporting Exchange contacts to PST using PowerShell commands.

Before we begin, let’s go through some prerequisites:

  • You must have the Exchange Server management tools installed on your computer.
  • You must have administrative privileges to perform the export operation.
  • You must be familiar with the Exchange Management Shell and PowerShell commands.

With these prerequisites in mind, let’s start the process of exporting Exchange contacts to PST using PowerShell commands.

Step 1: Connect to Exchange Online PowerShell

To export Exchange contacts to PST, you must first connect to Exchange Online PowerShell. Follow the below steps to connect:

  1. Open Windows PowerShell on your computer as an administrator.
  2. Run the following command to install the Exchange Online PowerShell module:Install-Module -Name ExchangeOnlineManagement
  3. Once the module is installed, run the following command to connect to Exchange Online PowerShell:Connect-ExchangeOnline -UserPrincipalName user@domain.com

Note: Replace user@domain.com with the UPN of the Office 365 user account that has the necessary permissions to perform the export operation.

  1. Enter the password for the user account when prompted.

Step 2: Export Exchange Contacts to PST

Once you have connected to Exchange Online PowerShell, use the New-MailboxExportRequest cmdlet to export the Exchange contacts to PST. Follow the below steps to perform the export:

  1. Run the following command to create a new mailbox export request:New-MailboxExportRequest -Mailbox user@domain.com -IncludeFolders "#Contacts#" -FilePath "\\ServerName\ShareName\Contacts.pst"

Note: Replace user@domain.com with the UPN of the user account whose contacts you want to export. Replace ServerName with the name of the file server on which you want to create the PST file. Replace ShareName with the name of the shared folder on the file server where you want to save the PST file.

  1. Once the export request is created, run the following command to start the export operation:Start-MailboxExportRequest -Identity "ExportRequestName"

Note: Replace ExportRequestName with the name of the export request that you created in step 1.

  1. Wait for the export operation to complete. You can check the status of the export request using the following command:Get-MailboxExportRequest -Identity "ExportRequestName" | fl Name,Status,PercentComplete,CompletionTimestamp

Note: Replace ExportRequestName with the name of the export request that you created in step 1.

Step 3: Download the PST File

Once the export operation is complete, you can download the PST file from the shared folder on the file server. You can use any file transfer protocol, such as FTP or SMB, to download the file to your local computer.

Congratulations! You have successfully exported Exchange contacts to PST using PowerShell commands.

Conclusion

Exporting Exchange contacts to PST using PowerShell commands is a simple and efficient method that can be used to maintain a backup or migrate data from one system to another. In this article, we have guided you through the process of exporting Exchange contacts to PST using PowerShell commands. Make sure to follow the prerequisites and steps carefully to avoid any errors.