Business Issue

Many clients complained that MOSS 2007 document management suffered from two inexcusable features:

  • Lack of unique identifiers for documents: Important in any Document Management System, particularly in Records Management
  • URLs to documents containing location information: If you have a look at MOSS/WSS document URL's they contained a location, but move a document to any different location, and you lose the link! This is a major shortcoming in an ECM system as it forces you to look for documents based on location, rather than on metadata.

Many people wanted unique numbering in documents and content within SharePoint 2007, which now comes out of the box in SharePoint 2010! In addition, you can create your own DocumentID by overriding the DocumentIDProvider abstract class so you can have whatever format of Document ID you like. What this means is that now SharePoint offers the following: 

  • Unique numbering for documents, which you can format in any way.
  • You can store documents in any location and they can still be referenced by the original URL that was assigned.
  • From a compliance, Records Management and Document Management perspective this ensures a unique identifier that can trace the document through the entire DM lifecycle.
  • Documents keep their original ID across Sites, Site Collections and even Web Applications.

Business Value

Potentially huge! The Document ID service fixes many issues related to ECM, and in terms of business value :

  • Time and cost savings from users not having to look for documents when incorrect URL's are sent.
  • Integration into an existing unique numbering system is now possible, great news for clients who are using existing DM systems.
  • Intelligent numbering offers up some really interesting possibilities for creating unique identifiers that actually have stored  information about the document contained within the ID.


  • ONLY content types that are derived from the Document Content Type will have unique IDs enabled, no list items will get IDs assigned


First, to enable the Document ID Feature, enable it from Site Collection Features as seen below. When this is done you will see a new option under "Site Settings -> Site Collection Administration" called Document ID Settings. When you click on this you will see the following options available:  

Assign Document IDs

Assign Document IDs: Click this and all existing documents and new documents will get an ID. This relies on a timer service, so it can take a little while (the timer service located in Central Admin is called the "Document ID Assignment Job".

Begin IDs with the following characters: This is the 4-12 document ID that you can configure. All that SharePoint will do is add a "- number" to the end of this like -1,-2 and so forth. If you don't like this, then you will have to write your own provider (see below.)

Document ID Look Up Search Scope

Use this search scope for ID Lookup: This is really cool. You can create a scope, and then if a user enters in a Document ID, it will directly open up instead of going to the results page. There are, however, some extra steps with this that I will post!

Now instead of a location based URL there is a link to /_layouts/DocIDRedir.aspx with tdocument ID at the end!  

Creating your own Provider

If you don't like the way that SharePoint increments the unique ID (which is actually adding 1 to the end) then you can always create your own. To do this, you need to do the following:

  1. Create a class that derives from Microsoft.Office.DocumentManagement.DocumentIdProvider listed below:

    namespace Microsoft.Office.DocumentManagement {

    public abstract class DocumentIdProvider { protected DocumentIdProvider(); public abstract bool DoCustomSearchBeforeDefaultSearch { get; }

    public abstract string GenerateDocumentId(SPListItem listItem);

    public abstract string[] GetDocumentUrlsById(SPSite site, string documentId); public abstract string GetSampleDocumentIdText(SPSite site); }

  2. Register the provider by using any of these methods, since I couldn't find (and neither could Michel Berneveld who wrote  a great article about this, see below) a stsadm or powershell command.
    public static void SetDefaultProvider(SPSite site); public static void SetProvider(SPSite site, Type providerType);

Timer Jobs

There are also two timer jobs associated with the Document ID service:  

Document ID Assignment Job: The Assignment job will assign a Document ID to existing content. Remember that even if you don't have unique IDs associated to documents within a Site Collection you can always retroactively assign these IDs, which is great news! Do I hear the chorus of applause, particulary from those users who are migrating from 2007 to 2010? :)

Document ID enable / disable: This timer jobs creates the Document ID column in the Document libraries.