SharePoint 2013 Backup Farm Automatically With a Powershell and Windows Task Schedule
In this post,I will show you SharePoint 2013 How to Backup Farm Automatically with a PowerShell and Windows Task Schedule.
First,to backup your Farm,you can use the powershell command Backup-SPFarm.
You can use the command to backup the farm a Full backup as in the following example.
Backup-SPFarm -BackupMethod Full -Directory D:\backup
And to Backup the farm a differential backup,you can use the command as in the following example.
Backup-SPFarm -BackupMethod Differential -Directory D:\backup
So Let's Create two PowreShell Script File,One for the full backup and another for the differential backup.
Step 1:Create a PowerShell for the full farm backup
Add-PSSnapin Microsoft.SharePoint.PowerShell
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
Backup-SPFarm -BackupMethod Full -Directory D:\backup
Save the file and name SPFarmFullBackup.ps1
Step 2:Create a PowerShell for the differential farm backup
Add-PSSnapin Microsoft.SharePoint.PowerShell
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
Backup-SPFarm -BackupMethod Differential -Directory D:\backup
Save the file and name SPFarmDiffBackup.ps1
Now,follow the steps below to create the tasks for Task Schedule to automate the execution of backup files.Assume we will full-backup weekly and differerntial-backup daily.
Step 3: Schedule a batch file to Run Automatically
- Click On Start
- Select "任务计划程序"
- In the center pane,right-click ,and click "创建基本任务"
- Assigning the task a meaningful name-such as SharePoint-BackupFarmFullWeekly
- Choose "每周"
- Specific the parameters for the weekly task schedule
- Next Choose "启动程序"
- Type in the command as the screenshot below
- The Task scheduler is intelligent enough to recognize that you want to run PowerShell and that you supplied arguments
Now,that we have created a Task,we have to make sure it runs highest Privilege. we have to make sure that when you run the file it not should fail.
-
Right Click the task you just created and Select Property
-
Click on "使用最高权限运行" then click OK.
- Repeate the steps above to create a diff-backup task schedule
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· spring官宣接入deepseek,真的太香了~