locked
Backup PST RRS feed

  • General discussion

  • Hi,

    I use this script for do my backup PST, but the script don't copy the offlines .pst.

    I need copy all psts for my profile.

    function ReleaseComObject($comobject){
        $ret=1
         do{
              $ret=[System.Runtime.Interopservices.Marshal]::ReleaseComObject($comobject)
         }while($ret -ne 0)
    }

    $Outlook = New-Object -ComObject Outlook.Application
    $stores = $Outlook.Session.Stores
    $paths=$stores | Where-Object { $_.FilePath -like '*.pst' } | %{$_.FilePath}
    ReleaseComObject $stores
    $outlook.Quit()
    ReleaseComObject $outlook
    while(get-process outlook -ea silentlycontinue){sleep 5}
    # now copy file(s).
    $target='H:'
    $paths|%{Copy-Item $_ $target}

    Wednesday, June 10, 2015 8:15 PM

All replies

  • Archive files are not loaded except when they are being archived to.

    I haveno idea what "offlines" is referring to.


    \_(ツ)_/

    Wednesday, June 10, 2015 8:27 PM
  • Sorry,

    The script don't find all files .pst on my pc.

    Wednesday, June 10, 2015 9:26 PM
  • That is correct.  It only backs up PSTs in the current Outlook Profile.


    \_(ツ)_/

    Wednesday, June 10, 2015 9:42 PM
  • I understand, but I need to change the script to save all the .pst files

    All files with .pst extension

    Wednesday, June 10, 2015 9:48 PM
  • You will have to find all of them first.  If they are not in Outlook then you will have to figure out where you put them.


    \_(ツ)_/

    Wednesday, June 10, 2015 9:56 PM