SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is this the right way to write a SharePoint 2010 differential backup script?

@echo off
echo ====================================================
echo Backup Script For  SharePoint Server 2010
echo ====================================================
cd \program files\common files\micrsoft shared\web server extensions\14\bin
@echo off
stsadm.exe -o backup -url http://mysitecollection -filename D:\SPBACK1116201011AM.bak  -nositelock  -overwrite -backupmethod differential
@echo off
echo completed
share|improve this question

PowerShell is the preferred method, you have more options, and will be the supported method going forward (STSADM is depreciated and only included in 2010 for 2007 compatibility).

The command is Backup-SPFarm -Directory -BackupMethod

Here is the TechNet reference

One of the biggest benefits is you can utilize SQL Snapshots, which you cant do from CA or STSADM. This means users can continue to interact with SharePoint while the Backup is taking place.

Additionally Todd Klindt has a post with two scripts, one to backup Site Collections and one for individual webs.

If you want to schedule them to run, you need to utilize task scheduler to kick off the PowerShell script.

TechNet article on PowerShell execution

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.