I have an issue I'd like to share with you, in SP2010.

Here is the situation: There are a big number of sites, let's say 500, within one or different site collections. In each site, there's a similar list (let's say a task list) with several task elements.

Every 5 minute, a timer job is supposed to run so as to check if a task is due or late and if so, trigger an alert by email to the user whose task is assigned.

Which best practise should we implement so as to be sure that ALL the sites will be "scanned" by the timer job within the time it has before the next run ?

Thank you by advance for your ideas, warnings or other replies to this topic !

  • 2
    If I understand you correctly, to me it sounds like saying "crawling" in the title is misleading -- this has nothing to do with search, correct? You're asking how best to create a timer job to check the tasks every 5 minutes and act appropriately.
    – shufler
    Aug 28, 2012 at 21:38
  • Yes shufler, my english is not "complete" so I said crawling, but it's nota bout searching. You understood right.
    – airdalle
    Aug 29, 2012 at 10:04

3 Answers 3


If your sites are split across a lot of Site Collections I see two options:

  • Create a normal Timer Job which uses KeywordQuery to search for due/late tasks

  • Create an EventReceiver which create a SPWorkItem with DeliveryDate set to the due time of the task and a SPWorkItemTimerJob to check it the task corresponding to Due SPWorkItems are completed and if not send out the mail

  • Thank you for your advice. I'll push that option to the developer and have it tested... (sorry if my english is not ok)
    – airdalle
    Aug 30, 2012 at 7:20

Use SPSiteDataQuery class. View a link here of doing it in one site collection. This can be used to crawl all sites in a site collection.

Check the link here for a similar example of how to do this on one site collection.

Make sure to set "" which will query all sites and subsites.

Best of luck

  • Thank you onzur for your reply ! I'll have a look at this and begin to have it tried by the developer (which i'm not)
    – airdalle
    Aug 29, 2012 at 10:06

Any possibility of changing your timer job solution into a workflow or event handler ?? You dont need to crawl each and every site.

  • Actually, Every "active" site will have to be "scanned" (or "checked" if it's best to say it like that). I'm not sure at this moment which event I should handle if I use an event receiver. I have to think about it
    – airdalle
    Aug 29, 2012 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.