SharePoint Online: Delete Drop Off Library using PowerShell

Requirement: Remove drop off library in SharePoint Online.

The site owner activated the “Content Organizer” feature in a site that brought “Drop Off  Library” into the SharePoint Online site. Now, when he tried deleting this library by going to library settings, he could not find the “Delete this document library” link in the library’s settings! Deactivating the content organizer feature didn’t help. So, How to delete the drop off library from SharePoint Online?

delete drop off library in sharepoint online

As the drop off library doesn’t provide the “Delete this Library” link, we must use PowerShell to delete this library.

SharePoint Online Remove drop off library using PowerShell

The drop-off library automatically routes documents to their appropriate location on the site with a content organizer feature. Once the feature is deactivated, We can delete the Drop Off Library by setting: the AllowDeletion property. Here is the PowerShell script to delete the drop off library in SharePoint Online:

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
##Variables for Processing
$SiteUrl = ""

Try { 
    #Get Credentials to connect
    $Cred= Get-Credential
    $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
    #Set up the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
    $Ctx.Credentials = $credentials
    #Get the Drop Off Library
    $Library = $Ctx.web.Lists.GetByTitle("Drop Off Library")

    #Set Allow Deletion Property
    $Library.AllowDeletion = $True

    #Delete the Library

    Write-Host -f Green "Drop Off Library Deleted Successfully!"
Catch {
    write-host -f Red "Error Deleting Drop Off Library!" $_.Exception.Message

PnP PowerShell to Delete a Drop-OFF library in SharePoint Online

You can also use PnP PowerShell to delete the drop off library:

$SiteURL = ""
$LibraryName="Drop Off Library"
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
#Get the Library to Delete
$Library = Get-PnPList -Identity $LibraryName -ErrorAction SilentlyContinue
#Check if Library exists
    #Allow Deletion
    $Library.AllowDeletion = $True
    #delete library in sharepoint online powershell
    Remove-PnPList -Identity $LibraryName -Recycle -Force
    Write-host -f Green "Library '$LibraryName' Deleted Successfully!"
    Write-host -f Yellow "Could not find Library '$LibraryName'"

In this article, we have discussed how to delete a drop-off library in SharePoint Online. By following the steps outlined in this guide, you can quickly and easily delete a drop-off library to reduce clutter in your SharePoint Online environment.

In SharePoint On-premises also, you can remove any document library or list by setting: “AllowDeletion” to “True” as in my other article: How to Delete any Document Library or List in SharePoint using PowerShell?

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 *