locked
Can I export an OST to PST using a script? RRS feed

  • Question

  • Hi all.  I would like to export my local OST file to a PST using a script (VB or otherwise).  Is this possible?

    To be clear, I know how to manually export my local OST to a PST (using Outlook 2013).  But I would like to carry this out via a script, if possible.

    The ultimate objective of this particular task is to automate the process of the OST-to-PST export, and have it carried out on a weekly schedule.

    I am running Win 10, x64.

    Thanks in advance.

    Wednesday, May 10, 2017 7:26 AM

All replies

  • Hi,

    There is no build-in script available to export ost to PST format. If you want to manually export OST file to PST file then you should try Export option of Microsoft Outlook.

    You can export OST file to Outlook PST manually but keep in mind that the manual export procedure can only be performed if you are connected to MS Exchange Server. That means that you need the be loged in with the original MAPI profile.

    See the below procedure;

    1. Go through Outlook
    2. Click the "File" Menu
    3. Choose the "Import and Export" option or press 't'.
    4. Next, press the "Export to a file" option and then hit the Next button.
    5. Opt for Personal File Folder (.pst) and then press the Next button.
    6. Choose items to be exported and check the Include sub-folders option.
    7. Select the target folder for saving the email items.
    8. Finally, hit the the "Finish" button.

    If you are not connected with MS Exchange server then consider to find some 3rd-party Export OST to PST application to export ost file every day. It works well with any edition of Windows based operating system.

    Hope the above information helps. Please tell me if you need further assistance.
    Thank you !!


    • Edited by aliceaggie Wednesday, May 10, 2017 8:55 AM
    Wednesday, May 10, 2017 8:54 AM
  • @aliceaggie Thanks for the reply.  But like I said, I am aware of the procedure to manually export an OST to PST.

    >> There is no build-in script available to export ost to PST format.

    Maybe it wasn't clear, but I'm asking if it is feasible to create a custom script to do this.  

    Thanks.

    Wednesday, May 10, 2017 8:57 AM
  • The ultimate objective of this particular task is to automate the process of the OST-to-PST export, and have it carried out on a weekly schedule.

    If this is for backup purpose, then "AutoArchive" feature in Outlook is a good choice.

    Read more:

    https://support.microsoft.com/en-us/help/830119/description-of-the-autoarchive-feature-in-outlook

    If you'd prefer to go via a scripting manner, one way is to use the MailboxExportRequest cmdlet to begin the process of exporting contents of a primary mailbox or archive to a .pst file:

    https://technet.microsoft.com/en-us/library/ff607299%28v=exchg.160%29.aspx

    As others mentioned above, on Outlook client side, you might need to leverage some third-party utilities for this task.

    Hope this helps.

    Regards,

    Ethan Hua


    Please remember to mark the replies as answers if they helped.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, May 11, 2017 8:58 AM
  • @Ethan thanks for the reply.  I have a follow-up question.  Yes indeed this is for backup purposes.  But after I backup the emails, I still want to be able to access them from my OST.  It appears that if I archive the emails, they will be moved from my OST to a PST--is that correct?  If so, that is not what I want.  The article you linked explicitly says:

    When you export items, the original items are copied to the export file, but they are not removed from the current folder.

    But I don't think the article explicitly says what happens to the original items during an archive.

    Also, in regards to the MailboxExportRequest cmdlet:  I looked at the page you linked and the first sentence reads:

    >> This cmdlet is available only in on-premises Exchange Server 2016.

    I am using Outlook 2013, and do not use Exchange Server. So does this mean the cmdlet will not work for me?

    Thanks.

    • Edited by cagross99 Sunday, May 21, 2017 9:27 AM
    Sunday, May 21, 2017 9:25 AM
  • @MKerry86 Thanks for your reply.  The links you posted seem to apply to Exchange Server, which I am not using.  Would I still be able to use them?

    Thanks.

    Sunday, May 21, 2017 9:31 AM