So you have written a Console application which is working with the SharePoint Object Model (API), but you get an error. Something similar to:
Login failed for user 'DOMAIN\User'.
Or (* see additional notes below!):
FileNotFoundException: The web application at http://some.site could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
That's because there are a couple of security requirements you need to meet. Basically, the user who is running the console application needs to:
- Be an Administrator on the computer he is running the app from (certainly, that would be the SharePoint server). Just add the user to the (Local) Administrators group on the machine.
- Have sufficient rights within the SharePoint site. If you are doing some administrative tasks, you would want this user to be given "Full Control" (group).
- Needs to have read/write permissions on the content database in the SQL server (or just make it db.owner). The database name is usually WSS_Content_{GUID}.
* Additional note about FileNotFound:
Although this is not covered by this article, there might be other reasons for this error. For example: Site collection not existing on this location or you need to add Alternate Access Mapping.
Well, I hope this helps someone out there,
Hristo Yankov
No comments:
Post a Comment