While provisioning a new Service App in SharePoint 2010 the other day I hit the ‘Enable Features’ button which inevitably enabled all SharePoint Server Standard Features across all Sites, Site Collections and Web Applications. This was the first time I hit this button and didn’t think much of it until I discovered the Drop off Library in the Quick Launch across all sites!
The Drop off Library cannot be simply removed through its Library Settings. Even if you deactivate the Site Feature that put it there. but who would want to manually remove the Library across a ton of site and then fix up the QuickLaunch respectively (The ‘Libraries’ menu item is left behind if it has no child items)
Here’s how to fix it with PowerShell.
Run the SharePoint 2010 PowerShell Management Shell as your Farm Administrator Account
To remove the Drop-Off Libraries on all SharePoint 2010 sites in a Site Collection (note; this will remove all Drop-off Library links from the QL since they wont exist):
Get-SPSite -Identity http://sitecollectionurl | 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() }
To remove all ‘Library’ QuickLaunch items if it has no child:
Get-SPSite http://sitecollectionurl | get-spweb -limit all | foreach-object{ $webURL = $_.url $web = Get-SPWeb $webURL $pubWeb = [Microsoft.Sharepoint.Publishing.PublishingWeb]::GetPublishingWeb($Web) $qlNav = $pubWeb.Navigation.CurrentNavigationNodes $qlHeading = $qlNav | where { $_.Title -eq “Libraries” } $qlLibraries = $qlHeading.Children if($qlLibraries.Count -eq 0) { $qlHeading.delete() } else { $qlLibraries | Select Title,ID $count = $qlLibraries.Count write-host “Other Libraries are listed on $url. Count = $count” } $pubWeb.Update() $web.Dispose }