The use should have permission on SharePoint_Shell_Access, if not Adds a user to the SharePoint_Shell_Access role for the specified database.
How to add user to SharePoint_Shell_Access?
Go to Security–>logins–>[Domain\MyName]
Right click–>properties.
Click on User Mapping.
Select “SharePoint_Config” database in the —–Users Mapped to this login section:
Select “SharePoint_Shell_Access” in the —Database role membership for :SharePoint_Config
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Restore-SPFarm -Directory -RestoreMethod Overwrite -Item [-BackupId ] [-Verbose]
Note:
If you are not logged on as the Farm account, you are prompted for the Farm account’s credentials.
How to add user to SharePoint_Shell_Access?
Go to Security–>logins–>[Domain\MyName]
Right click–>properties.
Click on User Mapping.
Select “SharePoint_Config” database in the —–Users Mapped to this login section:
Select “SharePoint_Shell_Access” in the —Database role membership for :SharePoint_Config
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Restore-SPFarm -Directory -RestoreMethod Overwrite -Item [-BackupId ] [-Verbose]
Note:
If you are not logged on as the Farm account, you are prompted for the Farm account’s credentials.