📧 Recipe · Exchange & Email
Repair Corrupted Outlook .pst/.ost Data File
Diagnose and fix Outlook startup errors caused by corrupted local data files
Complexity
Intermediate
Impact
end-user-impacting + data-integrity + workstation
Context
Why This Matters
Outlook stores mailbox data locally in two file types: .pst (Personal Storage Table — used for POP accounts, archives, and imported data) and .ost (Offline Storage Table — a cached copy of an Exchange/Microsoft 365 mailbox). When these files become corrupted due to abrupt shutdowns, disk errors, oversized files, or synchronization conflicts, Outlook typically fails to open with errors such as:
- "The file <path>.ost is not an Outlook data file (.ost)."
- "Cannot start Microsoft Outlook. Cannot open the Outlook window. The set of folders cannot be opened."
- "Errors have been detected in the file. Quit Outlook and all mail-enabled applications, and then use the Inbox Repair Tool."
This recipe walks through repairing or rebuilding the affected data file. Because .ost files are merely a local cache of a server-side mailbox, the safest remedy is usually to delete and let Outlook rebuild them. .pst files, however, contain authoritative data and must be repaired with scanpst.exe (the Inbox Repair Tool).
Expected Outcomes
- Outlook launches successfully without data-file errors.
- Corrupted
.ostfiles are rebuilt from the server mailbox (no data loss for Exchange/M365 accounts). - Corrupted
.pstfiles are repaired withscanpst.exeand a backup preserved. - You have a documented path for recurring corruption (profile recreation, OST size monitoring).
Risks & Considerations
Important warnings
- Always back up the .pst file before running scanpst.exe. The tool modifies the file in place and can occasionally make corruption worse.
- Do NOT delete a .pst file without confirming its contents are archived elsewhere — .pst data is not stored on the server.
- Deleting an
.ostis safe only when the account is an Exchange, Microsoft 365, or IMAP account that syncs from the server. Verify account type first. - Very large
.ostfiles (>50 GB) are a common cause of recurring corruption. Consider reducing cached mail range (e.g., to 12 months) after recovery. - Running
scanpst.exeon a file currently in use by Outlook will fail — close Outlook completely (check Task Manager forOUTLOOK.EXE) before starting. - If the user has Personal Archive or Online Archive mailboxes, those are separate and not affected by local file repair.
Required Permissions
| Permission | Why It's Needed |
|---|---|
| Local administrator on the user's workstation | Required to access Outlook data file locations under the user profile and to run repair tools. |
| User's mailbox credentials | Needed to re-sign in to Outlook after the .ost file is rebuilt. |
The fastest way to get this done: just ask Dex. Copy the prompt below and paste it into your Dex conversation.
For IT Admins
Paste into Dex Pro
For End Users
How an employee would ask Dex for help
Step 1: Identify the data file and error
- Note the exact error message shown when Outlook starts — it usually includes the full path to the offending file.
- Open Control Panel → Mail (Microsoft Outlook) → Data Files… to see all configured files and their types (PST vs OST).
Step 2: Close Outlook completely
- Exit Outlook.
- Open Task Manager (Ctrl+Shift+Esc) and end any lingering
OUTLOOK.EXEprocess.
Step 3a: Repair a .pst file (authoritative data)
- Locate
SCANPST.EXE. Typical paths:- Microsoft 365 / Outlook 2021:
C:\Program Files\Microsoft Office\root\Office16\SCANPST.EXE - Outlook 2019/2016:
C:\Program Files (x86)\Microsoft Office\root\Office16\SCANPST.EXE
- Microsoft 365 / Outlook 2021:
- Copy the target
.pstfile to a safe backup location. - Launch
SCANPST.EXE, click Browse, select the .pst file, and click Start. - When errors are reported, ensure Make backup of scanned file before repairing is checked, then click Repair.
- Re-run Scanpst until it reports no errors (may take several passes).
- Reopen Outlook.
Step 3b: Rebuild a .ost file (server-cached data)
- Confirm the account is Exchange / Microsoft 365 / IMAP (server-backed) via Control Panel → Mail → Email Accounts.
- Navigate to the OST location:
- Rename the problem file from
username@domain.osttousername@domain.ost.old. - Reopen Outlook — it will rebuild the OST and re-download mailbox contents from the server.
Step 4: If Outlook still won't start — recreate the profile
- Control Panel → Mail → Show Profiles…
- Click Add…, create a new profile, and configure the user's email account.
- Set Always use this profile to the new profile and launch Outlook.
Step 5: Preventive follow-up
- In Outlook: File → Account Settings → Account Settings → Change… and reduce Download email for the past: to 12 months for large mailboxes.
- Recommend the user shut down Outlook cleanly before rebooting the computer.
Not applicable for this recipe. Outlook data-file corruption is a local workstation issue — the .pst/.ost files live on the user's device and are repaired with on-device tools. There is no Microsoft Graph or REST endpoint to repair a local Outlook profile. If mailbox-level corruption is suspected on the server side (rare), an admin can use Graph/EXO to move the mailbox between databases, but that is a separate recipe. Use the Manual or Script approach on the affected machine.
The script below automates the workstation-side remediation: it closes Outlook, backs up the data file, and either launches scanpst.exe (for .pst) or renames the .ost so Outlook rebuilds it on next launch.
What the script does
- Accepts a target file path and operation mode (
PstRepairorOstRebuild). - Terminates any running
OUTLOOK.EXEprocess. - Creates a timestamped backup copy of the file.
- For
PstRepair: locatesSCANPST.EXEacross known Office install paths and launches it interactively. - For
OstRebuild: renames the .ost with a.oldsuffix so Outlook regenerates it.
Usage
# Rebuild a corrupted OST (Exchange / M365 account)
.\Repair-OutlookDataFile.ps1 -Mode OstRebuild -FilePath "$env:LOCALAPPDATA\Microsoft\Outlook\jane@contoso.com.ost"
# Repair a PST with scanpst.exe
.\Repair-OutlookDataFile.ps1 -Mode PstRepair -FilePath "C:\Users\jane\Documents\Outlook Files\archive.pst"Run the script in an elevated PowerShell window on the user's machine. Backups are written next to the original file with a .bak-yyyyMMddHHmmss suffix.
Next steps