Created
March 7, 2011 08:52
-
-
Save jrpbuilds/858244 to your computer and use it in GitHub Desktop.
A simple script to backup Outlook PST's to a network location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim FSO | |
Dim oShell | |
Set FSO = CreateObject("Scripting.FileSystemObject") | |
Set oShell = CreateObject("WScript.Shell") | |
Set objOutlook = GetObject(, "Outlook.Application") | |
For Each objInspector In objOutlook.Inspectors | |
objInspector.CurrentItem.Save | |
objInspector.Close True | |
Next | |
objOutlook.quit | |
' Sleep for 600 to give Outlook time to release the PST files | |
WScript.sleep 600 | |
' Path will need changing to your network location and PST location | |
FSO.CopyFile "C:\Outlook.pst", "\\server1\area$\Email\Outlook.pst" | |
FSO.CopyFile "C:\Archive.pst", "\\server1\area$\Email\Archive.pst" | |
oShell.Run "outlook" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment