I have Windows Server 2012 with SharePoint 2013 setup.

I created a PShell script and saved it to a ps1 which backs up the Farm:

Add-PsSnapin Microsoft.SharePoint.Powershell

Backup-SPFarm -Directory d:\backup\Farm -BackupMethod full

If I run this from PShell, i.e point to the location of the ps1 file and open it, it works perfectly.

However it does not run from Task Scheduler which is driving me nuts. Sched Task is:

  • Run when logged on or not
  • Run highest priveliges
  • Program/Scipt: -- C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  • Argument: location of PS1

Doesn't run on schedule or if run now (is allowed to run now in settings).

User account has access to DB and is same user I'm using to login as so it's fine when running from PShell directly. Also it is a local admin.

From Sched Task it just goes Running and then Ready but no backup created. As a test I added in a 2nd part to the script to send an email when it runs the task. The email is sent without a problem.

No errors, nothing in logs, just zilch.

Any ideas?

  • Execution policy? – BlueCompute Nov 12 '14 at 11:30
  • Hmm, hold on. I've added a "Start In" under the Actions. Just ran a test and worked ok. Will see if it runs ok again later. – IanH Nov 12 '14 at 11:59
  • Have already run Set-executionpolicy unrestricted – IanH Nov 13 '14 at 11:38
  • it ran last night now i've put "start in" in place. just going to see if it runs for a few days – IanH Nov 13 '14 at 11:40

please backup manually from central admin and make sure its Done properly.

then i think you need to check everything carefully and reconfigure all below steps

then test your command line character by character and test with powershell ISE

with powershell ISE

We have many command line backup methods in administration, that schedule it by schedule task in SharePoint 2010 and 2013 (also in Windows Servers or Project Server or ISA or TMG or Exchange)

In SharePoint you can configure Maintenance Plans SQL Database Backup Methods like this or this article :

SQL Server Management Studio  database back up task In the Object Explorer  Maintenance Plans

for Backup Scheduling like SharePoint Central Admin:

first of all you need to test these cmds

then need to decide about Repetition backup rate of your business. It may be required that full farm daily. or like 2nd example every hour backup partial from your farm like any or your application service like project server by this switch: ShowTree -Item

Examples [source here]:

--------------------EXAMPLE 1---------------------

Backup-SPFarm -Directory \\file_server\share\Backup -BackupMethod full -ConfigurationOnly

This example backs up the configuration settings of the farm to the \file_server\share\Backup directory.

--------------------EXAMPLE 2---------------------

Backup-SPFarm -ShowTree -Item "Microsoft SharePoint Foundation Web Application" -Verbose

This example shows which components of the farm would be backed up under the "Microsoft SharePoint Foundation Web Application" node, but do not actually back them up.

--------------------EXAMPLE 3---------------------

Backup-SPFarm -Directory C:\Backup -BackupMethod full -BackupThreads 10 -Force

Finally you configure schedule task like this article

configure backup SharePoint 2013 by PowerShell and schedule task

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.