Posted on 2008-10-18
Medium Priority
Last Modified: 2013-12-01
Need help to: write a script that copies, and renames them to username_date_outlookarchive.pst and then copies them to a shared folder on the server so backup exec can grab them; configure to run  a script to delete the archives after backupexec is complete.
Question by:gabepcsolutions
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
  • 2
LVL 21

Accepted Solution

AmazingTech earned 2000 total points
ID: 22753130
Who's going to run the script to copy the archives? Each user or an administrator?

On a user logoff script or user logon script you can run this batch file.
COPY "%UserProfile%\Application Data\Microsoft\Outlook\Outlook.pst" "\\Server\Share\Backup\%UserName%_%Date:/=.%_OutlookArchive.pst"

Open in new window


Author Comment

ID: 22753175
LVL 21

Expert Comment

ID: 22753186

The deleting part you'll have to get a script to run after backupexec.

DOS batch:
Del /q "\\server\share\backup\*.pst
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
File=WshShell.SpecialFolders("AppData") & "\Microsoft\Outlook\Outlook.Dat"
BackupFile=ServerFolder & "\" & WshShell.ExpandEnvironmentStrings("%UserName%") & "_" & Replace(Date,"/", ".") & "_OutlookArchive.PST"
wscript.echo "Source: " & File
wscript.echo "Target: " & BackupFile 
objFSO.CopyFile File, BackupFile
Set objFSO = Nothing
Set WshShell = Nothing

Open in new window


Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Microsoft will be releasing the Windows 10 Creators Update in just a matter of weeks. Are you prepared? Follow these steps to ensure everything goes smoothly and you don't lose valuable data on your PC.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

752 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