How to backup Outlook .PST files on Vista and Windows7
-------------------------------------------------------------------
NB: This tip is for system administrators only.
The problem:
Ms Outlook locks all .pst files while Outlook is open which triggers a bug when trying to copy a .pst across a network which results in your script hanging forever.
Therefore this direct copy won't work...
robocopy "C:\Users\%username%\AppData\Local\Microsoft\Outlook" "\\Backup\%username%\Outlook" /e /mir /mt:16 /W:3 /R:0
The solution:
1. First copy the Outlook files to a local directory like the user's TEMP...
robocopy "C:\Users\%username%\AppData\Local\Microsoft\Outlook" "C:\Users\%username%\AppData\Local\Temp\Outlook" /e /mir /mt:16 /R:0 /W:3
2. And then copy it from the TEMP to the backup drive...
robocopy "C:\Users\%username%\AppData\Local\Temp\Outlook" "\\Backup\%username%\Outlook" /e /mir /mt:16 /R:0 /W:3
3. Finally, do a cleanup on the user's TEMP directory...
del /s /f /q C:\Users\%username%\AppData\Local\Temp\Outlook\*.*
rd /s/q C:\Users\%username%\AppData\Local\Temp\Outlook
That's it! If you also need the XP (Xcopy based) solution write here.