Outlook 2003 : How to export a PST file with a script

Posted on 2006-10-31
Medium Priority
Last Modified: 2012-05-05

A PC I use has the PST file hidden away on a server somewhere.

I'd like to be able to make regular backups using a script.

I know I can go
Menu --> "import and export" --> "Export to a file" --> Next --> "Personal Folder File ( .PST )" --> etc ... etc,
and that this works, however that takes far to long and i'm sure their must be API's in Outlook that can be hooked onto to do this such that the .pst file is exported to a chosen local C:\ drive location. Anyone have the script ?

Question by:kes3
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
LVL 16

Expert Comment

ID: 17843829

There is a Microsoft Add-In to backup your PST:


The problem of time will be due to the PST being on a server ad it having to transfer the file across the network to your PC.


Author Comment

ID: 17844537


The Microsoft Add-In to backup PST works just fine but requires mouse clicking intervention.

I need a non intervention script so I can roll the back-up in with other automated backup process.


LVL 16

Expert Comment

ID: 17845287
Have a look at this guys blog on how he has done it:


He mentions he used Second Copy to perform the actual backup - you can use ntbackup to do the same thing.

He process is quite indepth becasue he closes Outlook whilst it runs.

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 17847525

You can just copy the the PST out from the server by using a batch file schedule task. But you need to close your Outlook First in order to allow the pst to be copy.

Create a simple batch file on your C: drive say eg backpst.bat

echo off
H:\                          <- example it is in your home drive in the server
Copy h:\*.pst C:\backup     <-- Copy the pst to a already created folder named backup

Launch your Scheduled Tasks from Control Panel
Run the wizard browse to your backpst.bat
It will prompt to be run by your login ID and password in order for the scheduler to work.
Set the frequency and do a test run to see if it work.


Author Comment

ID: 17848127

Hi Folks,

I don't know where the .pst file is stored such that I can make a copy of it.

It is not in the usual
H:\documents and settings\{username}\Local Settings\Application Data\Microsoft\Outlook\Outlook.pst

Is their a way I can find out using outlook where the .pst file is stored - I think it's somewhere on the network.


LVL 16

Expert Comment

ID: 17848358
In Outlook Click:


And it will show you your PSTs and datafiles. If this is blank you are most likely on Exchange and thus have no datafile as such.  (but no doubt you mail will be backed up centrally.

Author Comment

ID: 17849160

I think the files may well be kept on an Exchange server somewhere.

Remember this .pst backup will be incorporated into a script as part of a wider automated backup process so it has to be done by a script.

It thus seems that I need a script to drive the Outlook API's. Does anyone know how I can drive the windows / outlook interface with a script  such that i can create a backup of my .pst file ?
LVL 16

Expert Comment

ID: 17849507

If your emails are stored in an exchange mailbox it is not a PST file that you can backup.  The only way to be able to backup this data is to do as you initially did and export all the emails to a local PST Store.

Without understanding your company etc I would expect that your emails are backed up as part of a central backup routine by your IT department on a nightly basis.  These backups are able to be restored on an individual basis assuming your IT department have the skill level.

You require an automated Brick Level Backup of your mailbox.  This can be done with ExMerge (an Exchange Management tool) but unless you are a domain admin you will not be able to get anywhere near your mailbox, never mind automate the process.

This is a link to a website which details performing a brick level backup but it is intended for Mail Admins only: http://www.petri.co.il/brick_level_backup_of_mailboxes_by_using_exmerge.htm 
As for automating it, I would seriously suggest you don't as you could easily corrupt your mailbox whilst performing the backup anyway without having it happen during the server backup window.


Author Comment

ID: 17849578

Thanks Wadski for your insight : I'm not a mail admin and that is new to me.

However I am sure that much of windows can be driven with the windows shell, or vbs, or some ither scripting language.

Are their API's that can hook to Outlook to achieve this via a script.
LVL 16

Accepted Solution

Wadski earned 1000 total points
ID: 17850119

Unfortunately unless you are a domain administator you will not be able to drive scripts etc over the network. Permissions are setup to prevent exactly what you are trying to do to ensure data integrity.

I'm sorry I cannot help any further as you are going to require network permissions which I doubt you will have.

Good luck with this!


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question