An Outlook personal folders file (.pst) is a file that is commonly used to store e-mail messages for Internet e-mail accounts (POP3/IMAP), for archiving e-mail messages from an Exchange mailbox, or for organizing e-mail messages using rules that move the messages based on some criteria. If you are managing users in a company environment you occasionally need to manage .pst files in users’ Outlook profiles. This includes, but is not limited to the following actions.
· Add a new or existing .pst to the profile
· Remove a .pst file from the profile
· Retrieve information about .pst files in the profile
In order to help automate these three activities related to .pst files, sample tools are now available for download and use 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.
This also applies to Outlook XP
The following three tools can be downloaded from the Microsoft Download site.
· Getpst.exe
· Addpst.exe
· Delpst.exe
These tools use extended MAPI as this is the only supported way to programmatically change MAPI profiles. For additional information, please see the following article in the Microsoft Knowledge Base.
266352 INFO: MAPI Is the Only Way to Programmatically Change Profiles
http://support.microsoft.com/default.aspx?scid=kb;EN-US;266352
System Requirements
· All tools are built for Microsoft Outlook XP and higher.
· Microsoft Visual C++ 2008 SP1 Redistributable Package required.
To keep the size of the tools small, they were built without linking the MFC runtime. This means, that the installation of the “Microsoft Visual C++ 2008 SP1 Redistributable Package” is required. The “Microsoft Visual C++ 2008 SP1 Redistributable 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)
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2
Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ba9257ca-337f-4b40-8c14-157cfdffee4e
Microsoft Visual C++ 2008 SP1 Redistributable Package (ia64)
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=dcc211e6-ab82-41d6-8dec-c79937393fe8
General usage information
· Any application (for example, Outlook) that uses the MAPI profile being accessed by one of these tools needs to be closed before manipulating the PST services.
· All tools are executed from a command-prompt.
· Administrative privileges are not required.
· If you execute 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 on the tools
Details on each tool are provided in the following sections.
Getpst.exe
The Getpst.exe tool allows you retrieve information about the existing services (PST files) in a given e-mail profile. It is possible to retrieve information about all ANSI PST files, all UNICODE PST files, or both file types.
Please use the following link on the Microsoft Downloads site to download the Getpst.exe tool.
http://download.microsoft.com/download/1/B/2/1B2DF423-53A7-4DDE-82C4-D0FF033251B0/GetPst.exe
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 a couple of example commands to retrieve information from a profile:
· Retrieve information about ANSI PST files in a profile called MyOutlookProfile .
Getpst.exe -p MyOutlookProfile -f a
· Retrieve information about ANSI and Unicode PST files in a profile called 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 an example 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 allows you to add PST services (PST files) to a given e-mail 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 either in ANSI format (Outlook 97-2002 Personal Folders File) or UNICODE format (Office Outlook Personal Folders File).
Please use the following link on the Microsoft Downloads site to download the Addpst.exe tool.
http://download.microsoft.com/download/1/B/2/1B2DF423-53A7-4DDE-82C4-D0FF033251B0/AddPst.exe
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 a couple of example commands to add a PST file to a profile:
· Add a new Unicode PST file (data1.pst) to a profile called OutlookProfile . The PST displayname 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 called Outlook Profile . The PST displayname in Outlook will be Sample pst file . Note the use of quotes when there is 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 called OutlookProfile . The PST displayname 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 allows you remove services (PST files) from a given email profile. It is 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 drive. It only removes them from your Outlook profile.
Please use the following link on the Microsoft Downloads site to download the Delpst.exe tool.
http://download.microsoft.com/download/1/B/2/1B2DF423-53A7-4DDE-82C4-D0FF033251B0/DelPst.exe
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 a couple of example commands to add a PST file to a profile:
· Remove all ANSI PST files from a profile called MyOutlookProfile .
Delpst.exe -p MyOutlookProfile -f a
· Remove all PST files (both types) from a profile called MyOutlookProfile .
Delpst.exe -p MyOutlookProfile -f b
The following is an example output where the Delpst.exe tool removed all Unicode PST files from the profile. In this case, there were two PST files removed from the profile.
Installed UNICODE pst services: 2
Deleted pst service 0 successfully
Deleted pst service 1 successfully
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See
Terms of Use
(http://go.microsoft.com/fwlink/?LinkId=151500)
for other considerations.
Article ID: 2000021 - Last Review: June 3, 2009 - Revision: 3.0
APPLIES TO
- Microsoft Office Outlook 2003
- Microsoft Office Outlook 2007