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

 

 

 

 

 

本博客为 木宛城主原创,基于 Creative Commons Attribution 2.5 China Mainland License发布,欢迎转载,演绎或用于商业目的,但是必须保留本文的署名 木宛城主(包含链接)。如您有任何疑问或者授权方面的协商,请给我留言。

本文转自木宛城主博客园博客,原文链接:http://www.cnblogs.com/OceanEyes/p/sharepoint-2013-backup-farm-automatically-with-powershell-and-schedule.html,如需转载请自行联系原作者
目录
相关文章
|
1月前
|
监控 关系型数据库 MySQL
PowerShell 脚本编写 :自动化Windows 开发工作流程
PowerShell 脚本编写 :自动化Windows 开发工作流程
39 0
|
2月前
|
Windows
Powershell 重新排列去重 Windows环境变量
【9月更文挑战第13天】本文介绍如何使用PowerShell对Windows环境变量进行重新排列和去重。首先通过`$env:`访问环境变量,接着使用`-split`命令分割路径,再利用`Select-Object -Unique`去除重复项。之后可根据需要对路径进行排序,最后将处理后的路径组合并更新环境变量。注意修改环境变量前应备份重要数据并了解潜在影响。
127 10
|
6月前
|
存储 Ubuntu Linux
windows可以安装Ubuntu,ubuntu上也可以安装Powershell
powerhsell除了可以在windows上使用外,还可以在Ubuntu上部署开发环境。下面介绍Ubuntu上安装powershell的方法。
203 0
|
Shell Linux 开发工具
windows中cmd和PowerShell批处理命令
之前在 Git 批量删除本地分支,有用到 Linux 或 MacOS 下的批处理命令,这个命令中的 grep、xargs 本身是 Shell script,在 windows 中的 cmd 和 PowerShell 中是不能用的
101 0
|
JavaScript Windows
[Vue]解决 Windows PowerShell 不识别 vue 命令的问题
[Vue]解决 Windows PowerShell 不识别 vue 命令的问题
|
Windows
使用PowerShell获取Windows当前锁屏壁纸
使用PowerShell获取Windows当前锁屏壁纸 如果原始图片丢了,用这段代码就可以提取当前锁屏壁纸了!
183 0
|
应用服务中间件 nginx Windows
Windows PowerShell 中启动 Nginx 报错解决方案
Windows PowerShell 中启动 Nginx 报错解决方案
Windows PowerShell 中启动 Nginx 报错解决方案
|
XML 监控 数据格式
利用powershell进行windows日志分析
0x00 前言   Windows 中提供了 2 个分析事件日志的 PowerShell cmdlet:一个是Get-WinEvent,超级强大,但使用起来比较麻烦;另一个是Get-EventLog,使得起来相当简单,可以实时筛选,接下来,我们利用PowerShell 来自动筛选 Windows 事件日志。
2526 0
|
前端开发 Shell 开发工具
前端开发工具 vscode 使用技巧篇:控制台由powershell切换为cmd方法,windows下新旧版控制台cmd与powershell互切方法
前端开发工具 vscode 使用技巧篇:控制台由powershell切换为cmd方法,windows下新旧版控制台cmd与powershell互切方法
452 0
前端开发工具 vscode 使用技巧篇:控制台由powershell切换为cmd方法,windows下新旧版控制台cmd与powershell互切方法
下一篇
无影云桌面