How to Delete the Drop Off Library in SharePoint Server?

Problem:
When the content organizer feature is enabled, it creates a “Drop Off Library” document library on your SharePoint site. But disabling the feature does not remove the library! Also, you can’t simply delete “Drop Off Library” because the “Delete this document library” link is not available when you go to “Library Settings”.

how to remove drop off library sharepoint

What is Drop off Library in SharePoint?

The Drop off library comes with a content organizer feature is basically a way to set up one folder for users to upload files to it and automatically route the files to the appropriate locations that you have configured using content organizer rules.

How to delete a drop off Library in SharePoint?

To remove the drop off library SharePoint, you have to turn ON “AllowDeletion” flag of the library using the object model (using PowerShell, C#, SharePoint Manager Tool, etc.)

#Get the web
$Web = Get-SPWeb "https://intranet.crescent.com/sales"
    
#Get Drop off library
$DropOffLibrary = $Web.Lists.TryGetList("Drop Off Library")

#Remove Drop off library
$DropOffLibrary.AllowDeletion = $True
$DropOffLibrary.Update() 

Now, if you go to the drop off library’s settings, you’ll find the “Delete this Document Library” link. Simply click on the link and confirm the prompt to remove the drop off library from SharePoint.

how to delete drop off library in sharepoint 2013

PowerShell to Delete Drop Off Library in SharePoint

So, you’ve disabled the content organizer feature but could not delete the drop off library? Here is the PowerShell script to remove drop-off library from the SharePoint site.

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

#Define Variables
$WebURL = "https://intranet.crescent.com/sales"

#Get the web
$Web = Get-SPWeb $WebURL
    
#Get Drop off library
$DropOffLibrary = $Web.Lists.TryGetList("Drop Off Library")

If($DropOffLibrary -Ne $Null)
{
    #Remove Drop off library
    $DropOffLibrary.AllowDeletion = $True
    $DropOffLibrary.Update()
    $DropOffLibrary.Delete()
        
    Write-host -f Green "Drop-Off Library Removed from " $web.URL
}
else
{
    Write-host -f Yellow "Could not Find Drop-Off library in " $web.URL
}

Delete drop off library from All SharePoint Sites using PowerShell:

Let’s disable the Content Organizer feature and delete drop off library in all sites of a SharePoint web application using PowerShell.

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

#Define Variables
$WebAppURL = "https://intranet.crescent.com"
$FeatureName = "DocumentRouting" #Content Organizer feature

#Get all webs from the web application
$WebsCollection = Get-SPWebApplication $WebAppURL | Get-SPSite | Get-SPWeb -Limit ALL

#Iterate throgh each subsite
ForEach($Web in $WebsCollection)
{
    Write-host -f Yellow "Checking if Content Organizer Feature is enabled at :"$Web.URL
    #Check if feature is activated
    $Feature = Get-SPFeature -Web $Web.Url | Where-object {$_.DisplayName -eq $FeatureName}

    If($Feature -ne $null)    
    {
        #Disable feature
        Disable-SPFeature -Identity $FeatureName -url $Web.Url -Confirm:$false
    
        #Remove Drop off library
        $DropOffLibrary = $Web.Lists["Drop Off Library"]
        $DropOffLibrary.AllowDeletion = $True
        $DropOffLibrary.Update()
        $DropOffLibrary.Delete()
        
        Write-host -f Green "`t Content Organizer Feature has been Disabled and Drop-Off library Removed in " $web.URL
    }
}

Here is how to delete drop off library in SharePoint Online: Delete drop off library in SharePoint Online

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *