zoukankan      html  css  js  c++  java
  • 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:ackup

    And to Backup the farm a differential backup,you can use the command as in the following example.

    Backup-SPFarm -BackupMethod Differential -Directory D:ackup

    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:ackup

    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:ackup

    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

     

     

     

     

  • 相关阅读:
    spring初始化bean时执行某些方法完成特定的初始化操作
    flask与数据库连接相关操作
    解决flask中文乱码的问题
    flask(1)
    First Unique Character in a String (找到一个字符串中第一个不重复的字符)
    Java hashCode() 方法
    Java 类和对象
    Java 一维数组的定义和初始化
    Maven 在运行部署的时候是如何确定推送到 releases 还是 snapshots 仓库的
    Samples for Parallel Programming with the .NET Framework
  • 原文地址:https://www.cnblogs.com/OceanEyes/p/sharepoint-2013-backup-farm-automatically-with-powershell-and-schedule.html
Copyright © 2011-2022 走看看