SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
How does your web part execute the job? – Per Jakobsen Oct 1 '12 at 17:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.