DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 287497 - Last Review: September 12, 2013 - Revision: 17.0

This article was previously published under Q287497
If you are a Small Business customer, find additional troubleshooting and learning resources at the Support for Small Business (http://smallbusiness.support.microsoft.com) site.
For a Microsoft Outlook 2000 version of this article, see 197316  (http://support.microsoft.com/kb/197316/ ) .
For a Microsoft Outlook 2000 (IMO) version of this article, see 197315  (http://support.microsoft.com/kb/197315/ ) .
For a Microsoft Outlook 98 version of this article, see 181325  (http://support.microsoft.com/kb/181325/ ) .

On This Page

Summary

You can use the Inbox Repair tool (canpst.exe) to recover folders and items from a corrupted Personal Folders file (.pst) or Offline Folder file (.ost) in Microsoft Outlook 2010, Outlook 2007, Outlook 2003, and Outlook 2002. Scanpst.exe is installed automatically when you install Microsoft Office or Microsoft Outlook. Scanpst.exe is not available as a download.

This article describes what the Inbox Repair tool does and how it validates and corrects errors in a .pst or .ost file.

How to use the Inbox Repair tool

To recover folders and items from your corrupted .pst or .ost file by using the Inbox Repair tool, use the following steps.


Video: How to repair your Outlook Person Folder (.pst) files

Collapse this imageExpand this image
uuid=864d6ddc-b810-4c61-9737-9c4a1d6ca023 VideoUrl=http://aka.ms/ae4hso (http://aka.ms/ae4hso)
Collapse this imageExpand this image


Note The examples in the following sections show how to use the Inbox Repair tool on a .pst file, but you can use the same procedures for an offline folder (.ost) file.

Collapse this imageExpand this image
Click to expand
Step 1: Run the Inbox Repair tool to diagnose and repair errors


Collapse this imageExpand this image
Click to expand
Step 2: Recover the repaired items


Collapse this imageExpand this image
Click to expand
Step 3: Recover repaired items from the backup file

Advanced information

For those who are interested, this section describes exactly what the Inbox Repair tool does and how the tool validates and corrects errors in the .pst or .ost file.

What the Inbox Repair tool does

When you run the Inbox Repair tool on a Personal Folders (.pst) file, it does the following:
  • The Inbox Repair tool analyzes the Personal Folders (.pst) file directory structure and item headers to try to recover all folders and items.
  • If the Inbox Repair tool recovers the Personal Folders (.pst) file, it means that the repair tool found problems, and repaired what it could.
  • The Inbox Repair tool tries to turn any file into a Personal Folders (.pst) file. For example, if you rename an executable file to "Something.pst" (without quotation marks), the tool changes the file to a mountable .pst file.
  • The Inbox Repair tool makes a backup copy of any Personal Folders (.pst) file before you try to repair the file.

How the Inbox Repair tool validates and corrects errors

ScanPST mostly validates and corrects errors in the internal data structures of a .pst file. The .pst file is a database file. Therefore, structures such as BTrees and reference counts, are checked and repaired as necessary. These low-level objects have no knowledge of the upper-level structures, such as messages, calendar items, and so on, that are built upon them.

If ScanPST determines that a specific block of the structure or table is unreadable or corrupted, ScanPST removes it. If that block was part of a specific item in Outlook, the item will be removed when it is validated.

You may not expect this behavior, but the removal of the item is appropriate given the circumstances. Also, this specific kind of situation is rare, and it will always be entered in the ScanPST log file.

At a higher level, the more visible changes that you see involve folders and messages.

Folders

ScanPST examines every folder in the .pst and performs the following operations:
  1. ScanPST makes sure that there are the correct tables associated with the folder.
  2. ScanPST checks every row in each table and makes sure that the message or the subfolder exists in the system.
  3. If ScanPST cannot find the message or the subfolder, ScanPST removes the row from the table.
  4. If ScanPST does find the message or the subfolder, ScanPST validates the message or the folder.
  5. If that validation fails, the message or folder is considered corrupted, and it is removed from the table and deleted from the database.
  6. If the validation succeeds, ScanPST does another analysis to make sure that the now-recovered message values are consistent with the values in the table. Corrupted folders are recreated from scratch, if it is necessary. These folders contain no user data.
Messages

Most users will be concerned by message operations, because a corrupted item is likely to cause something to be deleted from the .pst file. ScanPST performs the following operations on messages:
  1. ScanPST does some basic validation of attachment tables and recipient tables. This operation resembles how a folder works with the messages in it.
  2. As soon as the recipient table is validated to guarantee recipients that are formatted correctly, ScanPST makes any changes that are required to synchronize these valid recipient table contents to the recipient properties on the message. ScanPST also guarantees that the message's parent folder refers to a valid folder. The following message properties are checked to make sure that they follow valid data formats:
    • PR_MESSAGE_CLASS

      ScanPST checks that this property exists. If the property does not exist, it is set to IPM.Note.
    • PR_MESSAGE_FLAGS

      Each flag is validated separately.
    • PR_SUBMIT_FLAGS

      This validation resembles the operation for message flags.
    • PR_CLIENT_SUBMIT_TIME

      If the submit flags indicate that the message is marked as submitted, this property must exist. If the submit flags do not indicate that the message is marked as submitted, the time is set to Now.
    • PR_SEARCH_KEY

      This property must exist. If the property is not present, a random GUID is generated for it.
    • PR_CREATION_TIME

      This property must exist. If the property is not present, the time is set to Now.
    • PR_LAST_MODIFICATION_TIME

      This property must exist. If the property is not present, the time is set to Now.
    • PR_MESSAGE_SIZE

      Sizes are recalculated and compared to stored values. If sizes differ by some delta, the calculated value is written.
    No validation is explicitly done on body-related properties or on subject-related properties, except the implicit low-level validation that this article discusses earlier. The recipient display properties are changed to be consistent with the recovered recipient table. As soon as this operation is complete, other algorithms are run to collect all the orphaned messages and to put them in an Orphans folder.

    For more information about binary trees (btrees), go to the following Microsoft website:
    An Extensive Examination of Data Structures (http://msdn2.microsoft.com/en-us/library/Aa289150(VS.71).aspx)

Applies to
  • Microsoft Outlook 2010
  • Microsoft Office Outlook 2007
  • Microsoft Office Outlook 2003
  • Microsoft Outlook 2002 Standard Edition
Keywords: 
kbrepair kbhowto kbvideocontent KB287497
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support