Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 !

share|improve this question
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 '12 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 '12 at 10:04
add comment

3 Answers

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

share|improve this answer
    
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 '12 at 7:20
add comment

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

share|improve this answer
    
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 '12 at 10:06
add comment

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

share|improve this answer
    
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 '12 at 10:07
add comment

Your Answer

 
discard

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

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