Thursday, July 5, 2012

Disabled Content Organizer - SharePoint 2010

If Content Organizer is enabled in your site, you will see a "Drop Off Library" document library either in your left Nav or when you are in All Site Content.


Disabled the feature in Site Settings does not remove the library. and you can't simply delete "Drop Off Library" because the "Delete this document library" link is not available when you are in the "Library Settings"... so how to delete this library?

Here is the PowerShell script that should save your day.

Powershell Script:

##=======================================================================================##
## PowerShell Disabled Content Organizer and delete "Drop Of Library" 
## Version: 1.0
## Last updated: 30 June, 2012
## Description: This script will loop through all the subsites in site collection 
##  and disable the Content Organizer Feature then remove the "Drop off Library"
## Reference: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/ff72703e-9ba0-4dc2-8221-ccda3529183d
##=======================================================================================##

if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
 Add-PSSnapin Microsoft.SharePoint.PowerShell;
}

Get-SPSite -Identity http://yoursitecollectionurl | Get-SPWeb -Limit ALL | ForEach-Object { 
  Disable-SPFeature –Identity DocumentRouting –url $_.Url –Confirm:$false
  $dropOffLibrary = $_.Lists["Drop Off Library"]
  $dropOffLibrary.AllowDeletion = "True"
  $dropOffLibrary.Update()
  $dropOffLibrary.Delete()
}

Hope this help!
Thanks

No comments:

Post a Comment