I have a WebPart where I'm executing a custom job. For most users it works fine but for some not, and in log I can see such an entry:

site enumeration stack at microsoft.sharepoint.administration.spsitecollection.get_item(int32 index)

Here is the implementation of Execute method:

public override void Execute(Guid targetInstanceId)
            SPWebApplication webApp = this.Parent as SPWebApplication;          

            SPList myList = webApp.Sites[0].RootWeb.Lists["myList"];
//operations on that list, updates too

Under what account is that job executed? Could it be the problem that some users do not have privileges and even webApp.Sites[0] could not be evaluated?

  • I have to mention I know, that timer service works on farm account (owstimer.exe) and I also know that RunWithElevatedPrivileges probably will have no result here – christof Oct 1 '12 at 14:14
  • 2
    How does your web part execute the job? – Per Jakobsen Oct 1 '12 at 17:34

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.