ARTICLE

How to remove Drop off library from the site using SharePoint 2010 Object Model

Posted by Vijai Anand Articles | SharePoint 2010 January 11, 2011
This article explains how to remove Drop off library from the SharePoint 2010 site using SharePoint 2010 Object Model.
Reader Level:


This article explains how to remove Drop off library from the SharePoint 2010 site using SharePoint 2010 Object Model.

SharePoint 2010 introduced a new feature called Content Organizer. This article does not explain the Content Organizer feature. After activitation of the Content Organizer feature a new Drop off Library will be created in the site. Like the normal document library you can't delete this document library. You won't be seeing an option "Delete this document library" (Drop off Library => Library Settings => Permissions and Management).

Fig1.gif

It doesn't work, if you try to remove this document library by deactivating the Content Organizer feature. You can remove this document library by using SharePoint object model or SharePoint Manager 2010 or Powershell.

Remove Drop Off Library using Powershell:

  • In this we will be seeing how to remove Drop Off Library using the following C# code.

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

    namespace DropOffLibrary{
        class Delete
        {
            static void Main(string[] args)
            {
                using (SPSite site = new SPSite("http://serverName:2011/"))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        SPList list = web.GetList("http://serverName:2011/DropOffLibrary/");
                        list.AllowDeletion = true;
                        list.Update();
                    }
                }
            }
        }


    }

  • Go to the SharePoint Site => Drop Off Library => Library settings => Permissions and Management.
  • Now you will be able to see "Delete this document library" option.

    Fig2.gif

Login to add your contents and source code to this article
comments
COMMENT USING
PREMIUM SPONSORS
Infragistics is experts in technology and design, and passionate about helping you build highly performant and stylish applications that solve problems, deliver inspiration, and maximize results.
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.
HTML 5 + JQUERY CONTROLS