SharePoint 2010 has a PowerShell backup feature called “Backup-SPFarm“. This will fail if the user running the command does not have full privileges on the underlying SharePoint SQL database. The standard error is not very helpful: “The local farm is not accessible“.
- Verify that you’re using PowerShell version 2.0 by starting PowerShell with ” powershell -version 2.0” and checking the running powershell version with “$host.version”.
- Grant database privileges to your backup user account, either “sysadmin” role on the SQL database engine, or “db_owner” role on *all* SharePoint databases. This account is the one you must use to run the PowerShell command Backup-SPFarm.
- Verify your SQL permissions using GUI SQL Management Studio or Command-Line “sqlcmd” clients to make sure you can view the various SharePoint SQL databases without permissions or connectivity errors.
Once you’re using PowerShell version 2.0 under an account with database privileges, you should have the fundamental requirements to successfully run the Backup-SPFarm cmdlet.