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

Posted on 2006-10-31
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
  • 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.


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.


U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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: 
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 250 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Workstation Monitoring Solution for Small Business Consultant! 5 127
Edit header 19 102
OST To PST Converter 5 216
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now