Member_2_4225740
asked on
Automating backup of PST files to server
I'm trying to figure out a way to automatically back up a user's PST file to his or her home folder on the server when he or she logs off the network.
Can this be done using VBScript?
Can this be done using VBScript?
Hi again,
the batch would look like something like this :
@echo off
copy c:\[your path to pst file] g:\path to the destination /v
the batch would look like something like this :
@echo off
copy c:\[your path to pst file] g:\path to the destination /v
Hi (again ...)
I didn't notice that you want this script to be run on logoff. It is easy to make it run on startup if you put the batch or a shortcut of the batch in the windows startup.
If you want to have it run at logoff you can setup up a gpo (go to run and type gpedit.msc then in the console go to User Configuration\Administrati ve Templates\System\Logon/Log off)
I didn't notice that you want this script to be run on logoff. It is easy to make it run on startup if you put the batch or a shortcut of the batch in the windows startup.
If you want to have it run at logoff you can setup up a gpo (go to run and type gpedit.msc then in the console go to User Configuration\Administrati
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'll go with ngravatt's suggestion.
I did manage to make some scripts that back up the Outlook data to the server. I post them here.
Here's the VB Script version that detects the user name and copies all the PST files to the home folder.
Option Explicit
Dim objNetwork, objShell
Dim strDriveLetter, strUserName, strOutPath, strHome, strCom
Set objNetwork = WScript.CreateObject("WScr ipt.Networ k")
strUserName = objNetwork.UserName
strOutPath="C:\Documents and Settings\" & strUserName & "\Local Settings\Application Data\Microsoft\Outlook\*.p st"
strHome= "\\server3\d$\home_folders \" & strUserName
strCom= "copy " & chr(34) & strOutPath & chr(34) & chr(32) & strHome
Set objShell = WScript.CreateObject("Wscr ipt.Shell" )
objShell.Run("%comspec% /c " & strCom)
WScript.Quit
I also made a version for AutoIt that's shorter but works just as well. AutoIt is a freeware scripting language that uses a BASIC-like language. It can be downloaded from http://www.autoitscript.com
$datapath ="C:\Documents and Settings\" & @UserName & "\Local Settings\Application Data\Microsoft\Outlook"
$copyto="\\server3\d$\home _folders\" & @UserName
FileCopy ($datapath & "\*.pst", $copyto,1)
FileOpenDialog ("PST Copy", "\\lrecdops-dc3\d$\home_fo lders\" & @UserName, "PST files (*.pst)")
I'll play with these scripts and see which works the best.
Thanks everyone for their help.
I did manage to make some scripts that back up the Outlook data to the server. I post them here.
Here's the VB Script version that detects the user name and copies all the PST files to the home folder.
Option Explicit
Dim objNetwork, objShell
Dim strDriveLetter, strUserName, strOutPath, strHome, strCom
Set objNetwork = WScript.CreateObject("WScr
strUserName = objNetwork.UserName
strOutPath="C:\Documents and Settings\" & strUserName & "\Local Settings\Application Data\Microsoft\Outlook\*.p
strHome= "\\server3\d$\home_folders
strCom= "copy " & chr(34) & strOutPath & chr(34) & chr(32) & strHome
Set objShell = WScript.CreateObject("Wscr
objShell.Run("%comspec% /c " & strCom)
WScript.Quit
I also made a version for AutoIt that's shorter but works just as well. AutoIt is a freeware scripting language that uses a BASIC-like language. It can be downloaded from http://www.autoitscript.com
$datapath ="C:\Documents and Settings\" & @UserName & "\Local Settings\Application Data\Microsoft\Outlook"
$copyto="\\server3\d$\home
FileCopy ($datapath & "\*.pst", $copyto,1)
FileOpenDialog ("PST Copy", "\\lrecdops-dc3\d$\home_fo
I'll play with these scripts and see which works the best.
Thanks everyone for their help.
Easier than that !
You can create a batch file that will copy the pst to the desired location (it is better to map the network drive if possible). (use the old ods copy or xcopy function).
The using the scheduler (start > all programs > accessories > system tools > task sceduler) you can run your batch at desired time ...