Monday, March 12, 2012

Simple Sitecollection Backup

If you have for each site collection a seperate contentdatabase, you can use this script.
Otherwhise you've just to modify the backupfilename.


$backup_path_root = "e:\backup\"
$all_sites = Get-SPSite -Limit all
foreach ($site in $all_sites)
{
write-host "Backup" $site
$backup_path = $backup_path_root + $site.ContentDatabase.name +".bak"
write-host "Backup File " $backup_path
backup-spsite $site -path $backup_path
}

No comments:

Post a Comment