Microsoft Outlook has been recognised as one of the most effective email applications for handling email data due to the fact that it is simple to operate and possesses many functions that are of great utility. However, there are situations in which OST files may become corrupted or unavailable due to errors that occur within the files themselves, issues that arise with synchronisation, or issues that arise with the Exchange Server at times. When you find yourself in this situation, it is essential to export the OST file to the PST format so that you can retrieve and recover the data.
You should use this method if you wish to export an OST file to Outlook PST without incurring any additional costs. By utilising PowerShell commands, we will demonstrate how to convert OST files to PST format in a way that is both simple and cost-free. Before we get into that, however, let's talk about the OST and PST files.
What is OST and PST files?
OST file (Offline Storage Table)
An OST file is generated by Microsoft Outlook whenever you connect to an Exchange Server, Internet Message Access Protocol (IMAP), or Microsoft 365 Account. The storage of a synchronised duplicate of the Outlook mailbox on your PC enables you to function without an internet connection as well.
PST (Personal Storage Table)
A PST file is a local data file used by Outlook to store, manage, and create a backup independently of the mail server.
Now, you understand the OST file and PST file. Let's move forward to a step-by-step process to convert OST to PST using PowerShell Command/Script.
Convert OST to PST with PowerShell Command
Now, follow the steps below carefully to complete the OST to PST conversion using a PowerShell script. Make sure not to skip any step.
Step 1: Export the OST file into CSV format
1. Find and Start Windows PowerShell as an Administrator
2. PowerShell generally doesn't let scripts run. Use the command below to modify the policy: Set-ExecutionPolicy -ExecutionPolicy Unrestricted
3. Type Y and hit Enter when the notification comes to confirm.
4. Now use the cd command to check where the OST file is stored offline. I am performing the command below because my OST file is on the desktop. So, when you use the CD command, make sure to give the correct path to your OST file.
My user name is HP, or you can find your user name in PowerShell by typing: whoami
My is this: Cd C:\Users\HP\Desktop
5. After that, use the command below to start the task of converting the OST file. Here is the path of the OST file and the CSV file, along with the file names and extensions.
New-Object -ComObject Outlook.Application | %{
$_.Session.AddStoreFromFile(“C:\Users\HP\Desktop\test-5.ost”)
$_.Session.GetDefaultFolder(6).Items |
Select-Object -Property Subject, ReceivedTime, SenderEmailAddress, RecipientEmailAddress, Body |
Export-Csv -Path “C:\Users\HP\Desktop\YourPSTFile.csv” -NoTypeInformation
}
Step 2: Build A Fresh PST file in MS Outlook
1. Launch MS Outlook and Choose New Items
2. Choose More Items >> Give Outlook data Items…
3. Give the name of the file and the place where you wish to make a new PST file.
Step 3: Lastly Convert the CSV file into PST format
1. Open Microsoft Outlook and click on "File."
2. Click on Import/Export after choosing Open & Export.
3: Choose Import from a different program or file and click Next.
4: Select "Comma Separated Value" and then click "Next."
5: Click on "Browse" to choose where the converted CSV file will be saved. Also, click the Next button after choosing "Allow duplicates to be created."
6: Select the mailbox where you wish to import the email databases, then click Next.
7: Check the box and click the Finish button.
8: A new PST file will now be created with all of your data.
Drawbacks and Limitations of the PowerShell Command Method
- This method doesn't work well with a large OST file.
- It's not helpful for an orphaned, inaccessible OST file.
- It only lets users convert emails that don't have attachments.
- Doesn't keep the folder structure, text formatting, or email attributes.
- It doesn't send contacts, calendars, notes, tasks, and other things.
- This procedure doesn't work for OST files that have been damaged.
Professional Solution to Export OST to PST
PowerShell command/Script method fails when your OST file is corrupted, inaccessible, or damaged. In this situation, the best and verified solution is to use Softaken OST to PST Converter. It is designed for effortless conversion of highly corrupted or any large size (50+) OST files to PST format or any other formats, while ensuring the 100% data integrity and formatting. Additionally, the tool works with all editions of Windows Operating Systems.
Steps to Convert OST to PST like a Pro
- Download and Run the OST Converter
- Browse and upload the OST files to convert
- Take a full preview of the uploaded OST Mailbox items
- Choose the PST file type from the list
- Optional: Filter data if required
- Now, choose the desired path and click the convert button
Conclusion
In this article, I tried to describe all the steps for utilising PowerShell Scripts and a professional solution to convert OST files to PST files. Users can pick any of the approaches and use them in a way that works best for them. All of the ways work and can export OST files to PST files. Some users can use a manual technique, but most professionals recommend an expert tool. Now, it totally depends on you.
FAQs (Frequently Asked Questions)
Q1. Can PowerShell Commands Convert OST to PST Directly?
Ans. No, PowerShell commands use the Outlook COM object, which cannot directly convert OST files to PST. It can only convert synced OST files to CSV format.
Q2. Orphaned OST files can be converted using a PowerShell Script
Ans. No, only synced OST files can be converted into CSV format with the PowerShell Script.
Q3. What is the Difference Between OST and PST?
Ans. OST: Offline copy of mailbox, tied to Outlook profile.
PST: Personal file, portable, can be created manually or via tools.
Q4. Best Solution to Convert OST files to PST format without Outlook
Ans. The best solution to convert OST files to PST format without Outlook is to use a reputable OST Converter. With the use of this utility, you can easily convert Offline OST files to PST format without requiring the Outlook installation
Q5. Where are OST files Located on Windows?
Ans. C:\Users\<YourUsername>\AppData\Local\Microsoft\Outlook
Q6. Can I Export Contacts, Calendars, or Tasks using PowerShell?
Ans. No, using PowerShell commands, you can only export emails. For full mailbox items, you need a professional tool.
Q7 How do I Find My Current Windows Username for PowerShell Commands?
Ans. Type whoami in PowerShell. It helps you to find the current Windows username.