views:

68

answers:

4

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.
A: 

In the question on the technet site, you have dumped a stack trace that shows an error accessing the configuration DB info from the registry (at, I guess, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB).

Could you check the permissions of this key and the identity of the w3wp processes ?

Timores
Sorry if that was a bit misleading, that isn't my question. Someone else posted that.
Mr Shoubs
Wow, I am the one being sorry. I should have read the question better. When you wrote the question, I had tried the cmdlet backup and it worked on my VM, so, sorry, no idea why it does not work.
Timores
Strange, maybe I am missing a prerequisite of some kind, but I don't know what it would be.
Mr Shoubs
A: 

You're using a local path to your backup folder. On http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/f755e7c1-bd0a-4c00-9be6-bbca83cf666b/, they say UNC paths should be preferred because Central Admin, the SharePoint server and the SQL Server instance need to access that folder.

They also say you have to issue a set-executionpolicy RemoteSigned if your local Powershell script is not signed. You might want to try that too.

Frédéric Hamidi
Tried what you suggested, but unfortunately not the solution.
Mr Shoubs

related questions