Drop off folder woes

Problem

Anyone who has enable the content organizer feature on a website would know that it creates a bunch of document libraries, including the drop off folder which cannot be deleted from the web interface.

This is especially a pain if you ‘enabled enterprise features’ on all websites using Central Administration. A drop off folder gets created on every website!

Solution

Powershell to the rescue:

$url = http://spsite url
$feature = Get-SPFeature “DocumentRouting”
Write-Host “Feature ID for Content Organizer is called “$feature.DisplayName
$site = New-Object Microsoft.SharePoint.SPSite($url)
foreach ($web in $site.AllWebs)
{
Write-Host “Subsite: ” $web.Title
if ($web.Features[$feature.ID])
{
Write-Host ”        -Feature” $feature.DisplayName “Found in ” $web.Title
Disable-SPFeature $feature -Url $web.Url -Force -Confirm:$false
Write-Host ”        -Feature” $feature.DisplayName “Disabled”
}
$list = $web.Lists[“DROP OFF LIBRARY”]
if (!$list)
{
Write-Host ”        -Drop Off Library not found”;
}
else
{
Write-Host ”        -“$list ” was found in web” $web
$list.AllowDeletion = $true;
$list.Update()
$list.Delete()
Write-Host ”        -“$list ” Deleted”
}
}

This script will look at the site specified in $url and all subsites in that site collection. It will do 2 things.

  1. Disable the DocumentRouting (Content Organizer) feature.
  2. Delete the Drop Off Library.

The output you get is:

Subsite:  Site 1
-Feature DocumentRouting Found in  Site 1
-Feature DocumentRouting Disabled
– Drop Off Library  was found in web Site 1
– Drop Off Library  Deleted
Subsite:  Site 2
-Feature DocumentRouting Found in  Site 2
-Feature DocumentRouting Disabled
-Drop Off Library not found
etc

 

Tags: ,

No comments yet.

Leave a Reply

%d bloggers like this: