1

We have a web service, implemented on our WFE servers, that performs multiple actions on SharePoint, one of which being the search.

Here is how I am doing it:

using (SPSite siteCollection = new SPSite(path)) { KeywordQuery keywordQuery = new KeywordQuery(siteCollection); keywordQuery.QueryText = strSearch; keywordQuery.KeywordInclusion = KeywordInclusion.AllKeywords; keywordQuery.AuthenticationType = QueryAuthenticationType.NtAuthenticatedQuery; SearchExecutor searchExecutor = new SearchExecutor(); ResultTableCollection resultTableCollection = searchExecutor.ExecuteQuery(keywordQuery); var resultTables = resultTableCollection.Filter("TableType", KnownTableTypes.RelevantResults); var objrelevantResults = resultTables.FirstOrDefault(); DataTable objResultDataTable = objrelevantResults.Table; } 

The problem: This only works with the farm account. A regular account, even with full control permission on the site collection used on the search doesn't work.

Is there a way around this or the user has to be permissioned at a higher level?

1 Answer 1

0

It sounds to me like you have this web service running as a separate process on the WFE, is that correct? In that case, on what user account is the service running? Also, what version of SharePoint?

You may need to register the service as an App with your SharePoint farm. Similar to how the Sp2013 Workflow engine, or Office Online Server, must be registered with the farm in order to perform privileged actions on behalf of non-priveleged users. I am not an expert at this but I believe this page is a suitable reference for what I'm talking about.

Edit: see also: Granting access using SharePoint App-Only

1
  • Actually it is not an app, it's a web service running on the server side, similar to those that are native to SharePoint(_vti_bin\sites.asmx etc) Commented Dec 5, 2019 at 14:40

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.