How to Delete Drop Off Library in SharePoint 2016?

Problem:
When content organizer feature is enabled, it creates "Drop Off Library" document library in 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?
Drop off library with content organizer feature is basically a way to set up one folder for users to upload files to and it will automatically route the files to the appropriate locations that you have configured using content organizer rules.

How to Delete drop off Library in SharePoint 2016?
To remove the drop off library SharePoint, you have to turn ON "AllowDeletion" flag of the library using Object model (using PowerShell, C#, SharePoint Manager Tool, etc)
#Get the web
$Web = Get-SPWeb "http://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 drop off library's settings, you'll find "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 2013
So you've disabled content organizer feature but could not delete drop off library? Here is the PowerShell script to remove drop off library from SharePoint site.
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

#Define Variables
$WebURL = "http://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:
Lets disable 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 = "http://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
How to Delete Drop Off Library in SharePoint 2016? How to Delete Drop Off Library in SharePoint 2016? Reviewed by Salaudeen Rajack on February 11, 2018 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.