Long running jobs in SharePoint

As part of a solution that I’m putting together at the moment I had a requirement that went something like this:

We want an export button on the search results page that allows us to save all the search results to the desktop

Designing "bulk actions" like export that affect a large set of SharePoint items as a single operation is a challenge. Using a custom SharePoint timer job allows us to keep these potentially very costly operations outside of the user context.

The design follows this basic flow:

  1. User selects a number of items (from search results) to process
  2. Selected items are "tagged" for attention from the timer job
  3. User is notified that the operation is "scheduled"
  4. Timer job runs and identifies "tagged" items
  5. Items are processed
  6. Report is generated
  7. User is notified of completion

Virtual PC and SIDs

I recently configured a set of virtual machines for use as my SharePoint demo environment. I used Microsoft Virtual PC 2007 and the differencing disk technique to keep disk space down and maximise re-use.

I created a base Windows Server 2003 virtual hard disk and then proceeded to create two differencing disks from it: one for my domain controller (dc.demo.local) and one for my SharePoint server (sharepoint.demo.local).

After successfully adding the SharePoint server to the domain I got the following error message when attempting to log in using a domain administrator account:
"The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain"

So it turns out that the SID for both machines are the same since the differencing disks are created off the same base disk.

Luckily it was easy to fix… I Downloaded NewSID from TechNet and ran through the wizard on my SharePoint server. This changed the SID for the machine to a nice shiny random one and rebooted.

Logging in with domain accounts is no longer a problem.