Task scheduler is required to automate the execution of backup files. In my last article, I have written about SharePoint full and differential backup, using central admin and PowerShell. Today, I am going to show you how to automate the execution of the backup file, using backup files script in task scheduler. Task scheduler is a constituent of Microsoft Windows that provides the ability to schedule the launch of the programs or the scripts at pre-defined times or after specified time intervals for task scheduling. With the help of task scheduling, we can reduce work for administrative department as well. We will get output efficiently without any extra resource utilized for the same.

Task scheduler was announced with Microsoft Windows 95 as a system agent, which was changed in successive operating systems by Microsoft. A task is clearly defined by associating or relating a set of actions, which can include launching an Application or taking some custom-defined action, to a set of triggers, which can either be time-based or an event-based. The function is available for task scheduler with those defined task states and configured accordingly.

Thus, let’s continue with how to configure Task Scheduler to automate the execution of backup files.

As we know, SharePoint 2013 backup structure and recovery processes includes farm backup and recovery. We can complete backup and recovery operations by using SharePoint central administration Website or Windows PowerShell cmdlets.

Refer to the URL given below for more details about backup in SharePoint 2013

The step by step configuration with the screenshots is given below.

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

Set-ExecutionPolicy -ExecutionPolicy “Unrestricted” -Force.

Backup-SPFarm -BackupMethod Full -Directory \\MyServer\SPBackups

Add-PSSnapin “Microsoft.SharePoint.PowerShell”.

Set-ExecutionPolicy -ExecutionPolicy “Unrestricted” –Force.

Backup-SPFarm -BackupMethod Differential -Directory \\MyServer\SPBackups -Item <ContentDatabaseName> [-Verbose].

Now, follow the steps given below to create the task for task scheduler to automate the execution of the script backup file.

Now, we will go ahead and schedule differential backup with an advanced option available on task scheduler

On the Action Page, we need to select an action from the drop down of the page, add program or script by browsing the file located on the system, add argument (optional).

Now, this is done. From here, we will keep getting new backup copy for each time interval, which we have mentioned above.

A few important points are there to execute the above task