Answered Powershell script for backing up all site collections

  • Tuesday, January 11, 2011 8:57 PM
     
     

    I want to create a powershell script for backing up all site collections within a web application and then add it to the scheduler.   Anyone know how to do this?    I have a script that i can run manually but when I try to create a batch file to do this it doesn't work and doesn't throw any errors.    Here is my script.  I found it on Todd Klindts blog:

    Get-SPWebApplication | Get-SPSite | ForEach-Object{$Fil
    ePath = "C:\Backup\teams\" + $_.Url.Replace("http://","").Replace("/","-") + ".b
    ak" ; Backup-SPSite -Identity $_.Url -Path $FilePath -force}

    Any ideas?

     


    EmilyBen

All Replies