文档章节

SharePoint 2013 Backup Farm Automatically With a Powershell and Windows Task Schedule

 木宛城主
发布于 2015/03/02 19:39
字数 340
阅读 4
收藏 0

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

 

 

 

 

 

© 著作权归作者所有

共有 人打赏支持
粉丝 2
博文 222
码字总数 199010
作品 0
黄浦
【Powershell】早期操作系统如何更新安装Windows PowerShell 4.0

http://social.technet.microsoft.com/wiki/contents/articles/21016.how-to-install-windows-powershell-4-0.aspx Windows PowerShell 4.0 is part of the Windows Management Framework 4.......

xifalniang
2016/09/02
0
0
PowerShell为什么强大

微软是一个很”低调”的公司,取名为微软,感觉有“微微软下去”的意思,这是个玩笑了。windows 操作系统 和office办公软件,如此之优秀,微软也没敢命名为PowerOS 和 PowerOffice,但是在Mon...

babylater
07/02
0
0
使用PowerShell关闭和锁定屏幕

ThinkPad T430没有关闭屏幕的功能键,不太方便,正好最近在折腾PowerShell,便写个脚本来实现这个功能。 1. 相关内容 1.1. PowerShell配置 为了更方便的使用脚本,需要用到3.0版的模块自动装...

joshuazhan
2014/01/04
0
0
Exchange 2019预览版部署安装——Part2

上一篇文章,大致分享了Exchange 2019的新功能和我测试Exchange 2019的大致环境介绍。下面具体分享安装过程。总体来说Exchange 2019在WIndows server core上安装比之前的版本安装简单很多,无...

jialt
07/29
0
0
使用VisualStudio构建自定义Snap-In

使用VisualStudio构建自定义Snap-In Snap-In 即在PowerShell V1 时候引入的二进制管理单元, 必须使用 Visual Studio 等开发工具进行开发。用于扩展系统功能,自定义CmdLet 由于这种方法专业...

strikene
06/26
0
0

没有更多内容

加载失败,请刷新页面

加载更多

arts-week10

Algorithm 905. Sort Array By Parity - LeetCode Review Who’s Afraid of the Big Bad Preloader? 一文读懂前端缓存 一个网络请求3个步骤:请求,处理,响应,而前端缓存主要在请求处响应这两步...

yysue
今天
0
0
00.编译OpenJDK-8u40的整个过程

前言 历经2天的折腾总算把OpenJDK给编译成功了,要说为啥搞这个,还得从面试说起,最近出去面试经常被问到JVM的相关东西,总感觉自己以前学的太浅薄,所以回来就打算深入学习,目标把《深入理...

凌晨一点
今天
5
0
python: 一些关于元组的碎碎念

初始化元组的时候,尤其是元组里面只有一个元素的时候,会出现一些很蛋疼的情况: def checkContentAndType(obj): print(obj) print(type(obj))if __name__=="__main__": tu...

Oh_really
昨天
6
2
jvm crash分析工具

介绍一款非常好用的jvm crash分析工具,当jvm挂掉时,会产生hs_err_pid.log。里面记录了jvm当时的运行状态以及错误信息,但是内容量比较庞大,不好分析。所以我们要借助工具来帮我们。 Cras...

xpbob
昨天
126
0
Qt编写自定义控件属性设计器

以前做.NET开发中,.NET直接就集成了属性设计器,VS不愧是宇宙第一IDE,你能够想到的都给你封装好了,用起来不要太爽!因为项目需要自从全面转Qt开发已经6年有余,在工业控制领域,有一些应用...

飞扬青云
昨天
6
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部