You are currently offline, waiting for your internet to reconnect

Outlook tools: Description of sample tools for managing PST files in your Outlook Profile

An Outlook personal folders (.pst) file is typically used to store email messages for Internet email accounts (POP3/IMAP), for archiving email messages from an Exchange mailbox, or for organizing email messages by using rules that move the messages based on some criteria. If you are managing users in a company environment, you must occasionally manage .pst files in users’ Outlook profiles. This includes, but is not limited to, the following actions:
  • Adding a new or existing .pst to the profile
  • Removing a .pst file from the profile
  • Retrieving information about .pst files in the profile
To help automate these three activities, sample tools are now available for download from the Microsoft Download site. This article provides information about these tools—how to download them and how to use them on an Outlook client. 
How to download the sample tools
The following tools can be downloaded from the Microsoft Download site:
These tools use extended MAPI, as this is the only supported way to programmatically change MAPI profiles. For more information, see INFO: MAPI is the only way to programmatically change profiles.
System requirements
  • All tools are built for Microsoft Outlook XP and later.
  • Microsoft Visual C++ 2008 SP1 Redistributable Package is required.
To keep the size of the tools small, they were built without linking the MFC run-time. This means that the installation of the Microsoft Visual C++ 2008 SP1 Redistributable Package is required. This package can be downloaded from the Microsoft Download Center. Click one of the following links for the appropriate download.: 

Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)

Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)

Microsoft Visual C++ 2008 SP1 Redistributable Package (ia64)

General usage information
  • Any application (for example, Outlook) that uses the MAPI profile that's accessed by one of these tools must be closed before you manipulate the PST services.
  • All tools are run from a command prompt. 
  • Administrative permissions are not required.
  • If you run these tools without passing any command-line parameter, a short help topic will be displayed to show the correct usage of the available command-line parameters.

Details about the tools

Details about each tool are provided in the following sections.

Getpst.exe

The Getpst.exe tool lets you retrieve information about the existing services (PST files) in a particular email profile. It's possible to retrieve information about all ANSI PST files, all UNICODE PST files, or both file types.

Click here to download the Getpst.exe tool.

When you run the tool, it requires the following parameters:

-p <Profilename> -f <a|u|b> for the pst type: Ansi|Unicode|Both

You can also specify the following optional parameters:

-l <Logfile name>

Here are some sample commands to retrieve information from a profile:  
  • Retrieve information about ANSI PST files in a profile that's named MyOutlookProfile.  

    Getpst.exe -p MyOutlookProfile -f a
  • Retrieve information about ANSI and Unicode PST files in a profile that's named MyOutlookProfile. The output from the tool is written to Output.txt in the current directory and to the Command Prompt window.  

    Getpst.exe -p MyOutlookProfile -f b -l Output.txt

    The following is sample output from the Getpst.exe tool, using the f b option (display information on both PST file types).

    No ANSI pst found in Mail Profile: MyOutlookProfile 
    UNICODE pst services: 1
    Display Name: Test pst
    Path to pst: d:\pstdata\Blank.pst

Addpst.exe

The Addpst.exe tool lets you add PST services (PST files) to a particular email profile. You can add either new or existing PST files to the profile. The file will be created at the specified file location. The PST file can be in either ANSI format (Outlook 97-2002 Personal Folders File) or UNICODE format (Office Outlook Personal Folders File).

Click here to download the Addpst.exe tool.

When you run the tool, it requires the following parameters:

-p <Profilename> -t <Path to Pst-File> -d <Displayname> -f <a|u> for the pst type: Ansi|Unicode

Here are some sample commands for adding a PST file to a profile:  
  • Add a new Unicode PST file (data1.pst) to a profile that's named MyOutlookProfile. The PST display name in Outlook will be MyNewPst.

    Addpst.exe -p OutlookProfile -t c:\Data\data1.pst -d MyNewPst -f u
  • Add a new ANSI PST file (data2.pst) to a profile that's named MyOutlookProfile. The PST display name in Outlook will be Sample pst file. Note the use of quotation marks when there's a space in the name.  

    Addpst.exe –p “Outlook Profile” –t “c:\My PST Files\new.pst” –d “Sample pst file” –f a
  • Add an existing Unicode PST file (c:\data\existing.pst) to a profile that's named MyOutlookProfile. The PST display name in Outlook will be MyOldPst.

    Addpst.exe -p OutlookProfile -t c:\Data\existing.pst -d MyOldPst -f u

If the PST file was added successfully, the following information appears in the Command Prompt window:

Retrieved message service table from profile: <profile name>
  Installed Pst Services: <number of pst files of that format in the profile>
Added <full path to .pst> as <pst display name> pst to the profile: <profile name>


Delpst.exe

The Delpst.exe tool lets you remove services (PST files) from a particular email profile. It's possible to remove all ANSI files, all UNICODE PST files, or all files of both types.  

This tool cannot be used to remove individually specified .pst files from a profile.

Note This tool does not delete PST files from your hard disk. It removes them only from your Outlook profile.  

Click here to download the Delpst.exe tool.

When you run the tool, it requires the following parameters:

-p <Profilename> -f <a|u|b> for the pst type: Ansi|Unicode|Both

Here are some sample commands for adding a PST file to a profile:  
  • Remove all ANSI PST files from a profile that's named MyOutlookProfile:  

      Delpst.exe -p MyOutlookProfile -f a
  • Remove all PST files (both types) from a profile that's named MyOutlookProfile:  

      Delpst.exe -p MyOutlookProfile -f b

The following is sample output after the Delpst.exe tool removes all Unicode PST files from the profile. In this case, two PST files were removed from the profile.  
Installed UNICODE pst services: 2

Deleted pst service 0 successfully

Deleted pst service 1 successfully
Properties

Article ID: 3089746 - Last Review: 09/01/2015 21:06:00 - Revision: 1.0

  • Microsoft Outlook 2010
  • Microsoft Office Outlook 2007
  • KB3089746
Feedback
> ocation.protocol) + "//c.microsoft.com/ms.js'" + "'><\/script>");