Monday, July 12, 2010

PowerShell SharePoint 2010 Backup

I need to schedule SharePoint 2010 Backup (site):
First create a PowerShell script in Notepad:
Backup-SPSite -Identity http://wss-08r2 -Path "\\servername\sharepoint2010\one\wss-08r2.bak" -Force
name the file - backup.ps1

Under folder C:\Windows\System32\WindowsPowerShell\v1.0 create profile.ps1 file it will be default profile for all users on the SharePoint front end server, edit the file by adding -
Add-PSSnapin Microsoft.SharePoint.PowerShell
And save the file.

Create a scheduled job and in Action tab put:
Action: powershell.exe
Add arguments: -command "PATH\backup.ps1"
where is PATH - path to the script file.

No comments:

Post a Comment