Delegate permissions to use Windows PowerShell to manage SharePoint
I have just discovered that by default permission is not granted to use Windows PowerShell to manage SharePoint. To enable me to do this I had to launch an elevated command prompt and issue the following commands:
$spcdb = Get-SPContentDatabase WSS_Content_Intranet
Add-SPShellAdmin -UserName WEBBWORLD\DAVE.WEBB -Datababase $spcdb
This will add the specified user to the local WSS_ADMIN_WPG group on each server in the farm and grant the SharePoint_Shell_Access role on the database.
Note: to run the Add-SPShellAdmin command you must be logged on as a user with:
- securityadmin server role on the SQL instance
- db_owner role for the database
- Administrators membership on the server