ARTICLE

How to change the custom document id provider to default document id provider in SharePoint 2010

Posted by Vijai Anand Articles | SharePoint 2010 February 20, 2011
In this article we will be seeing how to change the custom document id provider to the default document id provider in SharePoint 2010.
Reader Level:

In this article we will be seeing how to change the custom document id provider to the default document id provider in SharePoint 2010.

share.gif

Once the custom document id provider is configured we can change that to the default document id provider using API or powershell script.

Using C# code:

  • Add the following references.

    • Microsoft.SharePoint.dll
    • Microsoft.Office.DocumentManagement.dll
     
  • Add the following namespaces.

    • Using Microsoft.SharePoint;
    • Using Microsoft.Office.DocumentManagement;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.Office.DocumentManagement;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            SPSite site = new SPSite("http://serverName:20/");
            DocumentId.SetDefaultProvider(site);
            site.Dispose();
        }
    }
}


Using powershell script:

$site = Get-SPSite http://servername:20/
[Microsoft.Office.DocumentManagement.DocumentId]::SetDefaultProvider($site)
$site.Dispose()

 

Login to add your contents and source code to this article
post comment
     

Faltu code

Posted by Vishwajeet Nikam Jan 18, 2012
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts