1

I have had a good look around online and haven't been able to find anyone with this specific issue so I'm resorting to posting my own question.

I'm running a KeywordQuery in a web service which I call from my JavaScript. I've cut the code down so its very simple:

try{
using (KeywordQuery query = new KeywordQuery(SPContext.Current.Site)){
            query.QueryText = "test";

           query.SourceId = Guid.Parse("b09a7990-05ea-4af9-81ef-edfab16c4e31"); // Local People Results      
            //query.SourceId = Guid.Parse("8413cd39-2156-4e00-b54d-11efd9abdb89"); // Local SharePoint Results

            SearchExecutor se = new SearchExecutor();

            var rtc = se.ExecuteQuery(query);            }                
}catch (Exception ex){
// Log exception.
ex.Log();}

At the point of running ExecuteQuery I get the following exception:

System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. at Microsoft.Office.Server.Search.Query.ExceptionUtilities.ThrowBackwardCompatibleException(FaultException1 ex) at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.DoSpLoadBalancedUriWsOp[T](WebServiceBackedOperation1 webServiceCall, Int32 timeoutInMilliseconds, Int32 wcfTimeoutInMilliseconds, String operationName) at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.DoWebServiceBackedOperation[T](String operationName, Int32 timeoutInMilliseconds, Int32 wcfTimeoutInMilliseconds, WebServiceBackedOperation`1 webServiceCall) at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.Execute(QueryProperties properties) at Microsoft.Office.Server.Search.Query.Query.ExecuteQuery() at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQueryInternal(Query query) at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQuery(Query query) at Intranet.People.GetUsers(String searchTerm)

But this only happens if I have the SourceId set to the local people results. If I switch to the commented out line (Local SharePoint Results) it works fine. I'm an admin in all the places I think I should be (Search Service, User Profile, etc.) so I'm not sure why I'm being denied access.

I've been searching the internet for days on this issue now but cant find this issue. Does anyone have any thoughts on what might be the issue here and what might need changing to give me access to the Local People Results?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.