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?
Best Answer
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
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 :
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---------------------
--------------------EXAMPLE 2---------------------
--------------------EXAMPLE 3---------------------
Finally you configure schedule task like this article