Posted on 2008-10-18
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 500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

696 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