Thursday, April 28, 2011

Deleting a SharePoint List that errors with Invalid Filename

Ever get in a situation where you create an instance of a list from a list definition, then remove that list definition, and then you're hard pressed to delete it: You can't via the UI, Manage Content and Structure throws an error, and it doesn't show in SharePoint Designer?

Well you can delete it using using PowerShell with an assist from SharePoint Manager:

1) Open SharePoint Manager, go to the list you want to delete, and copy the ID of it.
2) In PowerShell, run the following:

$web = Get-SPWeb ""
$lc = $web.Lists

and then it'll be removed.

No comments: