I asked this on ServerFault, but didn't get any reply's, I know it's command line, but they should still be able to answer it, anyone here have any idea's?
I've ran the following (task description):
> Add-PsSnapin Microsoft.SharePoint.Powershell
> Backup-SPFarm -Directory E:\Backups -BackupMethod Full
But get this error:
Backup-SPFarm : Object reference not set to an instance of an object.
At line:1 char:14
+ Backup-SPFarm <<<< -Directory \\SHAREPOINTSERV\Backups -BackupMethod full
+ CategoryInfo : InvalidData: (Microsoft.Share...mdletBackupFarm:SPCmdletBackupFarm) [Backup-SPFarm], NullReferenceException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletBackupFarm
I can backup manually through the Admin site, so all the services/permissions are setup correctly.
I can't find much helpful info on this does anyone know why I'm getting this error message?
- running SQL Server 2008 R2 and Win2008 Standard (x64).
- tried setting the directory to a UNC path and a local path.
- tried
set-executionpolicy ByPass
(and RemoteSigned) - I'm logged on as a user with enterprise admin security credentials
- SharePoint & SQL Server are installed on the same machine
Not sure if relevent, but I'm a developer and have never used power-shell before (nor has it been used on this machine before)... so my only guess is there is some sort of pre-requisite that I am supposed to have run or know about?
EDIT: VERBOSE OUTPUT
PS E:\Backups\Script> Backup-SPFarm -Directory E:\Backups -BackupMethod Full -Verbose
VERBOSE: Leaving BeginProcessing Method of Backup-SPFarm.
VERBOSE: Performing operation "Backup-SPFarm" on Target "SHAREPOINTSERV".
Backup-SPFarm : Object reference not set to an instance of an object.
At line:1 char:14
+ Backup-SPFarm <<<< -Directory E:\Backups -BackupMethod Full -Verbose
+ CategoryInfo : InvalidData: (Microsoft.Share...mdletBackupFarm:SPCmdletBackupFarm) [Backup-SPFarm], NullReferenceException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletBackupFarm
VERBOSE: Leaving ProcessRecord Method of Backup-SPFarm.
VERBOSE: Leaving EndProcessing Method of Backup-SPFarm.