Automating SharePoint 2010 Backup Using Windows PowerShell

Video length: 5:31

Video description: This video walks through the process of using Windows PowerShell and Windows Task Scheduler to automate the nightly backup of a SharePoint 2010 farm.

Detailed video steps below:

To automate the backup of your SharePoint 2010 farm:

Create a backup script

  • Create a new folder anywhere on your network. Ex: C:\Scripts
  • Create a script file with the following text and extension: Ex: C:\Scripts\Backup.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShellBackup-SPFarm -directory \\ProvideFileShareDirectoryPath -Backupmethod Full

Schedule the backup script

  • Start the Windows task Scheduler by clicking on Start Administrative tools, Task Scheduler
  • From Actions, select Create Task
  • Under the General Tab, provide a name and a description (Ex: SharePoint Backup, Backup of the entire SharePoint farm) and choose the “Run whether user is logged on or not” and check the “Run with highest privileges” checkbox
  • Under the Triggers tab, click New and schedule a Daily or as often as you like to run the task and click OK
  • Under the Actions tab, click New and keep the action parameter as Start a program, under settings program/script type PowerShell.exe and next to Add arguments, provide the path of your script file location (Ex: C:\Scripts\Backup.ps1) click OK and provide the password.

To test the scheduled backup task

  • Right click on the created task and choose Run.
  • switch over to the backup directory provided above and notice the backup files being generated.

Leave a Comment