views:

1436

answers:

2

Is it possible to create a user with permissions of both a local administrator and NETWORK SERVICE?

I've got a Sharepoint timer job which runs stsadm for which it needs local administrator permissions. On the other hand temer jobs are also used by other services which need NETWORK SERVICE permissions and those to sets of permissions only overlap, so I need a user with the "sum" of the permissions to run OWSTIMER under.

(I know that most of the operations you can perform with stsadm sharepoint administration API can be used, by in my case it is the operation which moves a site collection between content databases for which there seems to be no API equivalent).

+1  A: 

I recommend always using domain accounts - SharePoint works best on servers connected to an Active Directory server. For production environments a best practice is using a least privilege account. I always create the following domain account dedicated to SharePoint services:

DOM\spservice

You do not need to grant any special privileges to this account as SharePoint will automatically do this for you when you specify the account during setup.

Lars Fastrup
Thanks! An interesting point, I didn't pay much attention to the setup process, will check it out.
axk
You're right. This is the way to set it up.
axk
A: 

I can't help you with the user permissions (Lars hit the important points), but I wanted to share some information that may be of use.

You mentioned that you're trying to move site collections between content databases and haven't found an API the can be leveraged. Have you looked into SharePoint's Content Deployment API (also know as the PRIME API) to see if it can assist? The types of which I'm speaking are located in the Microsoft.SharePoint.Deployment namespace, and they provide you with mechanisms to export (via SPExport) site collections as CAB files and then import them (via SPImport).

SharePoint leverages types in this namespace for its own content deployment paths and jobs (in MOSS); it's also the API that is leveraged by the STSADM.EXE executable for export (STSADM.EXE -o export) and complementary import operations. For that matter, it's also used by SharePoint Designer for it's site "backup" and "restore" operations.

For an example of how this API can be leveraged, check out the SharePoint Content Deployment Wizard tool on CodePlex (http://www.codeplex.com/SPDeploymentWizard).

I hope this gives you a potential alternative to shelling out to a command line in your timer job!

Sean McDonough
Tnanks, but exporting and importing has some limitations so I had to use stsadm which moves sites on the SQL level and dosn't rely on any public API's for this operation (as Reflector shows).
axk
Aleksey, you can actually carry out all of the STSADM-related backup and restore operations via the object model. If you're actually doing a site collection backup/restore, see the associated documentation on the SPSiteCollection type (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsitecollection.backup.aspx). For a full catastrophic backup/restore, check out the SPBackupRestoreConsole type (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.backup.spbackuprestoreconsole.aspx). These two types do the work for STSADM on backups :-)
Sean McDonough

related questions